Difference between revisions of "R3d.Body"
| Line 51: | Line 51: | ||
[[r3d.Body:setLinearVelocity]] ''sets the body linear velocity''<br/><!--GIDEROSMTD:r3d.Body:setLinearVelocity(number) sets the body linear velocity--> | [[r3d.Body:setLinearVelocity]] ''sets the body linear velocity''<br/><!--GIDEROSMTD:r3d.Body:setLinearVelocity(number) sets the body linear velocity--> | ||
[[r3d.Body:setMass]] ''sets the mass of the body''<br/><!--GIDEROSMTD:r3d.Body:setMass(number) sets the mass of the body--> | [[r3d.Body:setMass]] ''sets the mass of the body''<br/><!--GIDEROSMTD:r3d.Body:setMass(number) sets the mass of the body--> | ||
| + | [[r3d.Body:setSprite]] ''sets the body Sprite''<br/><!--GIDEROSMTD:r3d.Body:setSprite(sprite) sets the body Sprite--> | ||
[[r3d.Body:setTransform]] ''sets the body transform matrix''<br/><!--GIDEROSMTD:r3d.Body:setTransform(transform) sets the body transform matrix--> | [[r3d.Body:setTransform]] ''sets the body transform matrix''<br/><!--GIDEROSMTD:r3d.Body:setTransform(transform) sets the body transform matrix--> | ||
[[r3d.Body:setType]] ''sets the body type''<br/><!--GIDEROSMTD:r3d.Body:setType(type) sets the body type--> | [[r3d.Body:setType]] ''sets the body type''<br/><!--GIDEROSMTD:r3d.Body:setType(type) sets the body type--> | ||
[[r3d.Body:testPointInside]] ''checks if a point is inside the body''<br/><!--GIDEROSMTD:r3d.Body:testPointInside(x,y,z) checks if a point is inside the body--> | [[r3d.Body:testPointInside]] ''checks if a point is inside the body''<br/><!--GIDEROSMTD:r3d.Body:testPointInside(x,y,z) checks if a point is inside the body--> | ||
| + | [[r3d.Body:updateMassPropertiesFromColliders]] ''updates the body mass based on its colliders''<br/><!--GIDEROSMTD:r3d.Body:updateMassPropertiesFromColliders() updates the body mass based on its colliders--> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
Latest revision as of 00:01, 19 December 2025
Supported platforms: ![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Available since: Gideros 2019.10
Description
Once the dynamics world has been created, you can create rigid bodies into the world.
A rigid body represents an object that you want to simulate in the world. It has a mass, a position, an orientation, a type, and one or several collision shapes. You can also create joints between the bodies in the world.
The dynamics world will compute collisions between the bodies and will update the bodies position and orientation accordingly every time step.
In ReactPhysics3D, the RigidBody class (which inherits from the CollisionBody class) is used to describe a rigid body.
Methodsr3d.Body:applyLocalForceAtCenterOfMass applies a force to this body |
Constantsr3d.Body.STATIC_BODY |