Class Rigidbody2D
Represents a 2D physics behavior for game elements.
Inherited Members
Namespace: Genesis.Core.Behaviors.Physics2D
Assembly: Genesis.dll
Syntax
public class Rigidbody2D : RigidBodyBehavior2D
Constructors
Rigidbody2D(PhysicHandler)
Initializes a new instance of the Rigidbody2D class with the specified physics handler.
Declaration
public Rigidbody2D(PhysicHandler handler)
Parameters
Type | Name | Description |
---|---|---|
PhysicHandler | handler | The physics handler. |
Properties
AngularFactor
Gets or sets the angular factor for the rigid body.
Declaration
public Vec3 AngularFactor { get; set; }
Property Value
Type | Description |
---|---|
Vec3 |
EnablePhysic
Gets or sets whether physics is enabled.
Declaration
public bool EnablePhysic { get; set; }
Property Value
Type | Description |
---|---|
bool |
LinearFactor
Gets or sets the linear factor for the rigid body.
Declaration
public Vec3 LinearFactor { get; set; }
Property Value
Type | Description |
---|---|
Vec3 |
Methods
CreateRigidBody(float, int, int)
Creates the rigid body with the specified mass.
Declaration
public override void CreateRigidBody(float mass, int collisionGroup = -1, int collisionMask = -1)
Parameters
Type | Name | Description |
---|---|---|
float | mass | The mass of the rigid body. |
int | collisionGroup | |
int | collisionMask |
Overrides
CreateRigidbody(float, float, float, int, int)
Creates the rigid body with the specified mass, capsule radius, and capsule height.
Declaration
public void CreateRigidbody(float mass, float capsuleRadius, float capsuleHeight, int collisionGroup = -1, int collisionMask = -1)
Parameters
Type | Name | Description |
---|---|---|
float | mass | The mass of the rigid body. |
float | capsuleRadius | The radius of the capsule shape. |
float | capsuleHeight | The height of the capsule shape. |
int | collisionGroup | |
int | collisionMask |