42 int getId()
const {
return id_; }
45 void setPosition(
float x,
float y,
float z);
54 void setRotation(
float qx,
float qy,
float qz,
float qw);
56 float getRotX()
const;
58 float getRotY()
const;
60 float getRotZ()
const;
62 float getRotW()
const;
65 void setLinearVelocity(
float vx,
float vy,
float vz);
67 float getLinearVelocityX()
const;
69 float getLinearVelocityY()
const;
71 float getLinearVelocityZ()
const;
74 float getMass()
const;
77 void setAngularVelocity(
float wx,
float wy,
float wz);
79 float getAngularVelocityX()
const;
81 float getAngularVelocityY()
const;
83 float getAngularVelocityZ()
const;
86 std::vector<float> localToWorldPoint(
float x,
float y,
float z)
const;
90 std::vector<float> worldToLocalPoint(
float x,
float y,
float z)
const;
94 std::vector<float> localToWorldVector(
float x,
float y,
float z)
const;
98 std::vector<float> worldToLocalVector(
float x,
float y,
float z)
const;
100 std::vector<float> getLocalPointVelocity(
float x,
float y,
float z)
const;
104 std::vector<float> getWorldPointVelocity(
float x,
float y,
float z)
const;
107 void applyForce(
float fx,
float fy,
float fz);
109 void applyForceAt(
float fx,
float fy,
float fz,
float x,
float y,
float z);
111 void applyTorque(
float tx,
float ty,
float tz);
113 void applyLinearImpulse(
float ix,
float iy,
float iz);
115 void applyLinearImpulseAt(
float ix,
float iy,
float iz,
float x,
float y,
float z);
117 void applyAngularImpulse(
float ix,
float iy,
float iz);
119 void applyLocalForce(
float fx,
float fy,
float fz,
float x,
float y,
float z);
121 void applyLocalForceToCenter(
float fx,
float fy,
float fz);
123 void applyLocalTorque(
float tx,
float ty,
float tz);
125 void applyLocalLinearImpulse(
float ix,
float iy,
float iz,
float x,
float y,
float z);
127 void applyLocalLinearImpulseToCenter(
float ix,
float iy,
float iz);
129 void applyLocalAngularImpulse(
float ix,
float iy,
float iz);
135 void setTargetTransform(
float x,
float y,
float z,
float qx,
float qy,
float qz,
float qw,
139 void setLinearDamping(
float damping);
141 float getLinearDamping()
const;
143 void setAngularDamping(
float damping);
145 float getAngularDamping()
const;
147 void setGravityScale(
float scale);
149 float getGravityScale()
const;
152 void setSleepEnabled(
bool enabled);
154 bool isSleepEnabled()
const;
156 void setSleepThreshold(
float threshold);
158 float getSleepThreshold()
const;
163 void setMotionLocks(
bool linearX,
bool linearY,
bool linearZ,
bool angularX,
bool angularY,
166 bool isLinearXLocked()
const;
168 bool isLinearYLocked()
const;
170 bool isLinearZLocked()
const;
172 bool isAngularXLocked()
const;
174 bool isAngularYLocked()
const;
176 bool isAngularZLocked()
const;
192 void setMassProperties(
float mass,
float centerX,
float centerY,
float centerZ,
193 float inertiaXX,
float inertiaYY,
float inertiaZZ,
194 float inertiaXY = 0.f,
float inertiaXZ = 0.f,
195 float inertiaYZ = 0.f);
197 void resetMassProperties();
199 float getInertiaXX()
const;
201 float getInertiaYY()
const;
203 float getInertiaZZ()
const;
205 float getInertiaXY()
const;
207 float getInertiaXZ()
const;
209 float getInertiaYZ()
const;
211 float getLocalCenterX()
const;
213 float getLocalCenterY()
const;
215 float getLocalCenterZ()
const;
217 float getWorldCenterX()
const;
219 float getWorldCenterY()
const;
221 float getWorldCenterZ()
const;
224 void setType(
const std::string &bodyType);
226 std::string getType()
const;
229 void setFixedRotation(
bool fixed);
231 bool isFixedRotation()
const;
234 void setActive(
bool active);
236 bool isActive()
const;
239 void setBullet(
bool bullet);
241 bool isBullet()
const;
244 void setAwake(
bool awake);
246 bool isAwake()
const;
292 Shape3D *newConvexHullShape(
const std::vector<float> &
vertices,
int maxVertices = 64,
311 const std::vector<int32_t> &
indices,
312 bool weldVertices =
true,
float weldTolerance = 0.001f,
313 bool identifyEdges =
true,
bool useMedianSplit =
false);
330 Shape3D *newHeightFieldShape(
int countX,
int countZ,
float cellSizeX,
float cellSizeZ,
331 const std::vector<float> &heights,
float globalMin,
332 float globalMax,
bool clockwiseWinding =
false);
356 bool isValid()
const;
377 std::unique_ptr<IBodyBackend3D> backend_{};
#define EVENGINE_API_WORLD
std::vector< std::uint32_t > indices
std::array< float, 3 > scale
OceanRenderBackend backend
Owning, generation-qualified results for cross-module 3D physics queries.
Process-local, generation-qualified handles owned by the physics domain.
Move-only, checked operation results for the common layer.
std::array< double, 2 > vertices[3]
Move-only operation result carrying either a value or Status.
Backend-neutral 3D rigid body in meter-space coordinates (+Y up by convention). Owned by a World3D; c...
Body3D & operator=(const Body3D &)=delete
const World3D * getWorld() const
Returns the owning world as a read-only borrowed pointer.
World3D * getWorld()
Returns the owning world, or null after invalidation.
Body3D(const Body3D &)=delete
int getId() const
Stable id used by collision events.
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.
Owning, backend-independent shape source; metres, local quaternion XYZW.
Private bridge used exclusively by Box3D composition and native query code.