Class StaticMeshBehavior
Represents a Physics behavior for a static mesh in 3D.
Inherited Members
Namespace: Genesis.Core.Behaviors.Physics3D
Assembly: Genesis.dll
Syntax
public class StaticMeshBehavior : PhysicsBehavior
Constructors
StaticMeshBehavior()
Declaration
public StaticMeshBehavior()
Properties
RigidBody
Gets or sets the RigidBody associated with this behavior.
Declaration
public RigidBody RigidBody { get; set; }
Property Value
| Type | Description |
|---|---|
| RigidBody |
Methods
CreateRigidBody(PhysicHandler, float, Mesh)
Creates the RigidBody for the StaticMeshBehavior.
Declaration
public void CreateRigidBody(PhysicHandler handler, float mass, Mesh mesh)
Parameters
| Type | Name | Description |
|---|---|---|
| PhysicHandler | handler | Physics handler responsible for managing elements. |
| float | mass | Mass of the rigid body. |
| Mesh | mesh | Mesh data for creating the collision shape. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when the parent element is not of type Element3D. |
GetPhysicsObject()
Returns the physics object.
Declaration
public override object GetPhysicsObject()
Returns
| Type | Description |
|---|---|
| object |
Overrides
GetPhysicsObject<T>()
Returns the physics object with the specified type.
Declaration
public override T GetPhysicsObject<T>()
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
Overrides
OnDestroy(Game, GameElement)
Destroys the behavior.
Declaration
public override void OnDestroy(Game game, GameElement parent)
Parameters
| Type | Name | Description |
|---|---|---|
| Game | game | |
| GameElement | parent |
Overrides
OnInit(Game, GameElement)
Checks on init if the parent type is an Element3D.
Declaration
public override void OnInit(Game game, GameElement parent)
Parameters
| Type | Name | Description |
|---|---|---|
| Game | game | |
| GameElement | parent |
Overrides
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when the parent element is not of type Element3D. |
OnRender(Game, GameElement)
Renderer callback
Declaration
public override void OnRender(Game game, GameElement parent)
Parameters
| Type | Name | Description |
|---|---|---|
| Game | game | |
| GameElement | parent |
Overrides
OnUpdate(Game, GameElement)
Update callback.
Declaration
public override void OnUpdate(Game game, GameElement parent)
Parameters
| Type | Name | Description |
|---|---|---|
| Game | game | |
| GameElement | parent |
Overrides
UpdateRigidBody()
Updates the RigidBody's position and scaling based on the associated parent element.
Declaration
public void UpdateRigidBody()