Method CreateDynamicBody
- Namespace
- Box3D
- Assembly
- Box3D.NET.dll
CreateDynamicBody(Vector3, Quaternion?)
Creates a fully simulated body that responds to forces and collisions.
public Body CreateDynamicBody(Vector3 position = default, Quaternion? rotation = null)Parameters
positionVector3-
The initial world position of the body origin.
rotationQuaternion?-
The initial world rotation, or null for none.
Returns
- Body
-
The new body, with no shapes attached yet.
Examples
Body crate = world.CreateDynamicBody(new Vector3(0.0f, 10.0f, 0.0f));
crate.AddBox(Box.Cube(0.5f));
Remarks
Shorthand for CreateBody(BodyDefinition.Dynamic(position, rotation)).
Use the definition overload when you need anything beyond a pose.