35 int getId()
const {
return id_; }
38 void setPosition(
float x,
float y,
float z);
47 void setRotation(
float qx,
float qy,
float qz,
float qw);
49 float getRotX()
const;
51 float getRotY()
const;
53 float getRotZ()
const;
55 float getRotW()
const;
58 void setLinearVelocity(
float vx,
float vy,
float vz);
60 float getLinearVelocityX()
const;
62 float getLinearVelocityY()
const;
64 float getLinearVelocityZ()
const;
67 float getMass()
const;
70 void setAngularVelocity(
float wx,
float wy,
float wz);
72 float getAngularVelocityX()
const;
74 float getAngularVelocityY()
const;
76 float getAngularVelocityZ()
const;
79 std::vector<float> localToWorldPoint(
float x,
float y,
float z)
const;
83 std::vector<float> worldToLocalPoint(
float x,
float y,
float z)
const;
87 std::vector<float> localToWorldVector(
float x,
float y,
float z)
const;
91 std::vector<float> worldToLocalVector(
float x,
float y,
float z)
const;
93 std::vector<float> getLocalPointVelocity(
float x,
float y,
float z)
const;
97 std::vector<float> getWorldPointVelocity(
float x,
float y,
float z)
const;
100 void applyForce(
float fx,
float fy,
float fz);
102 void applyForceAt(
float fx,
float fy,
float fz,
float x,
float y,
float z);
104 void applyTorque(
float tx,
float ty,
float tz);
106 void applyLinearImpulse(
float ix,
float iy,
float iz);
108 void applyLinearImpulseAt(
float ix,
float iy,
float iz,
float x,
float y,
float z);
110 void applyAngularImpulse(
float ix,
float iy,
float iz);
112 void applyLocalForce(
float fx,
float fy,
float fz,
float x,
float y,
float z);
114 void applyLocalForceToCenter(
float fx,
float fy,
float fz);
116 void applyLocalTorque(
float tx,
float ty,
float tz);
118 void applyLocalLinearImpulse(
float ix,
float iy,
float iz,
float x,
float y,
float z);
120 void applyLocalLinearImpulseToCenter(
float ix,
float iy,
float iz);
122 void applyLocalAngularImpulse(
float ix,
float iy,
float iz);
128 void setTargetTransform(
float x,
float y,
float z,
float qx,
float qy,
float qz,
float qw,
132 void setLinearDamping(
float damping);
134 float getLinearDamping()
const;
136 void setAngularDamping(
float damping);
138 float getAngularDamping()
const;
140 void setGravityScale(
float scale);
142 float getGravityScale()
const;
145 void setSleepEnabled(
bool enabled);
147 bool isSleepEnabled()
const;
149 void setSleepThreshold(
float threshold);
151 float getSleepThreshold()
const;
156 void setMotionLocks(
bool linearX,
bool linearY,
bool linearZ,
bool angularX,
bool angularY,
185 void setMassProperties(
float mass,
float centerX,
float centerY,
float centerZ,
186 float inertiaXX,
float inertiaYY,
float inertiaZZ,
187 float inertiaXY = 0.f,
float inertiaXZ = 0.f,
188 float inertiaYZ = 0.f);
190 void resetMassProperties();
217 void setType(
const std::string &bodyType);
219 std::string getType()
const;
222 void setFixedRotation(
bool fixed);
224 bool isFixedRotation()
const;
227 void setActive(
bool active);
229 bool isActive()
const;
232 void setBullet(
bool bullet);
234 bool isBullet()
const;
237 void setAwake(
bool awake);
239 bool isAwake()
const;
259 Shape3D *newSphereShape(
float radius,
float density = 1.f,
float friction = 0.2f,
285 Shape3D *newConvexHullShape(
const std::vector<float> &
vertices,
int maxVertices = 64,
286 float density = 1.f,
float friction = 0.2f,
304 const std::vector<int32_t> &
indices,
305 bool weldVertices =
true,
float weldTolerance = 0.001f,
306 bool identifyEdges =
true,
bool useMedianSplit =
false);
323 Shape3D *newHeightFieldShape(
int countX,
int countZ,
float cellSizeX,
float cellSizeZ,
324 const std::vector<float> &heights,
float globalMin,
325 float globalMax,
bool clockwiseWinding =
false);
349 b3BodyId
raw()
const {
return bodyId_; }
351 bool isValid()
const;
#define EVENGINE_API_WORLD
std::vector< std::uint32_t > indices
std::array< float, 3 > scale
Owning, generation-qualified results for cross-module 3D physics queries.
Process-local, generation-qualified handles owned by the physics domain.
std::vector< Point > vertices
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
3D rigid body (Box3D) in meter-space coordinates (+Y up by convention). Owned by a World3D; create pr...
bool isAngularYLocked() const
Whether rotation around Y is locked.
bool isAngularXLocked() const
Whether rotation around X is locked.
Body3D & operator=(const Body3D &)=delete
float getInertiaYZ() const
Local symmetric inertia tensor YZ component.
const World3D * getWorld() const
Returns the owning world as a read-only borrowed pointer.
float getLocalCenterY() const
Local center of mass Y coordinate.
bool isAngularZLocked() const
Whether rotation around Z is locked.
float getWorldCenterX() const
World center of mass X coordinate.
float getInertiaYY() const
Local inertia tensor YY component about the center of mass.
bool isLinearYLocked() const
Whether translation along Y is locked.
World3D * getWorld()
Returns the owning world, or null after invalidation.
float getInertiaXZ() const
Local symmetric inertia tensor XZ component.
bool isLinearZLocked() const
Whether translation along Z is locked.
float getLocalCenterZ() const
Local center of mass Z coordinate.
bool isLinearXLocked() const
Whether translation along X is locked.
Body3D(const Body3D &)=delete
int getId() const
Stable id used by collision events.
float getInertiaXX() const
Local inertia tensor XX component about the center of mass.
float getInertiaXY() const
Local symmetric inertia tensor XY component.
float getWorldCenterZ() const
World center of mass Z coordinate.
float getInertiaZZ() const
Local inertia tensor ZZ component about the center of mass.
float getWorldCenterY() const
World center of mass Y coordinate.
float getLocalCenterX() const
Local center of mass X coordinate.
PhysicsBodyHandle runtimeHandle() const noexcept
Returns the process-local solver handle used by PhysicsLink.
3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Sh...
Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixe...
Optional physics backend for vehicle mobility and body attach.