Photon Fusion 2.1.1

AbstractPhysicsBody Class Referenceabstract

Abstraction for handling both 2D and 3D Rigidbodies. More...

Inherited by PhysicsBody2D, and PhysicsBody3D.

Public Types

enum  BodyInterpolation
 Abstraction to handle interpolation settings from both 2D and 3D bodies. Values are Asserted to be correct in the constructors of the appropriate concrete class. More...

Public Member Functions

void AddForce (Vector3 force)
 Method to apply force on the rigidbody.
void AddTorque (Vector3 torque)
 Method to apply torque on the rigidbody. For 2D the Z axis is used.

Public Attributes

bool WasColliding
 Indicate if the rigidbody was colliding on the previous physics step.

Properties

float AngularDrag [get, set]
 Coefficient of angular drag.
Vector3 AngularVelocity [get, set]
 Angular velocity of the rigidbody.
Component Component [get]
 The Component component of the rigidbody.
float Drag [get, set]
 Coefficient of drag.
int EncodedConstraints [get, set]
 Rigidbody constraints encoded into an int32 field.
NetworkRigidbodyFlags Flags [get]
 Networked flags representing a 2D or 3D rigid body state and characteristics.
Vector3 Gravity [get]
 Gravity value from the respective 2D or 3D project physics settings.
Vector3 InertiaTensor [get, set]
 The Inertia tensor of the physics body. For 2D the Z axis is used.
BodyInterpolation Interpolation [get, set]
 The interpolation setting of the physics body.
bool Kinematic [get, set]
 Define if the rigidbody is kinematic.
Vector3 LinearVelocity [get, set]
 Linear velocity of the rigidbody.
float Mass [get, set]
 Mass of the Rigidbody.
Vector3 Position [get, set]
 Rigidbody position.
Quaternion Rotation [get, set]
 Rigidbody rotation.
bool Sleeping [get, set]
 Define if the rigidbody is sleeping.
Transform Transform [get]
 The Transform component of the rigidbody.
bool Valid [get]
 True if this AbstractPhysicsBody has a valid rigidbody reference.

Detailed Description

Abstraction for handling both 2D and 3D Rigidbodies.

Member Enumeration Documentation

◆ BodyInterpolation

Abstraction to handle interpolation settings from both 2D and 3D bodies. Values are Asserted to be correct in the constructors of the appropriate concrete class.

Enumerator
None 

Do not smooth the object's movement.

Interpolate 

Smooth movement between existing frames.

Extrapolate 

Smooth movement based on extrapolation from it's current position.