载入中...
搜索中...
未找到
eve::physics::Shape3D类 参考

3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Shape; owned by the world. 更多...

#include <Shape3D.h>

Public 类型

enum class  Kind {
  Box , Sphere , Capsule , ConvexHull ,
  TriangleMesh , HeightField
}
 Shape geometry kind. 更多...
 

Public 成员函数

 Shape3D (World3D *world, Body3D *body, b3ShapeId shapeId, PhysicsShapeHandle runtimeHandle, Kind kind, float a, float b, float c, std::vector< float > hullVertices={}, int hullMaxVertices=64, std::vector< float > meshVertices={}, std::vector< int32_t > meshIndices={}, b3MeshData *meshData=nullptr, bool meshWeldVertices=true, float meshWeldTolerance=0.001f, bool meshIdentifyEdges=true, bool meshUseMedianSplit=false, std::vector< float > heightValues={}, int heightCountX=0, int heightCountZ=0, float heightCellSizeX=1.f, float heightCellSizeZ=1.f, float heightGlobalMin=0.f, float heightGlobalMax=0.f, bool heightClockwise=false, b3HeightFieldData *heightData=nullptr)
 Internal: wraps a Box3D shape (use Body3D::new*Shape).
 
 ~Shape3D ()
 
 Shape3D (const Shape3D &)=delete
 
Shape3D & operator= (const Shape3D &)=delete
 
int getId () const
 Stable world-local id, preserved when sensor state recreates the backend shape.
 
PhysicsShapeHandle runtimeHandle () const noexcept
 Process-local generation-qualified handle owned by World3D.
 
void setTag (int tag)
 User-defined integer tag preserved for the wrapper lifetime.
 
int getTag () const
 User-defined integer tag, zero by default.
 
void setHitEventsEnabled (bool enabled)
 Enables significant collision hit events for this shape.
 
bool areHitEventsEnabled () const
 Whether significant collision hit events are enabled.
 
std::string getKind () const
 Kind name including primitives, "convexHull", "triangleMesh", or "heightField".
 
void setBoxSize (float width, float height, float depth)
 Atomically changes full box dimensions in meters.
 
void setSphereRadius (float radius)
 Atomically changes sphere radius in meters.
 
void setCapsuleSize (float height, float radius)
 Atomically changes capsule segment height and radius in meters.
 
void setConvexHullVertices (const std::vector< float > &vertices, int maxVertices=64)
 Atomically rebuilds a convex hull from packed local XYZ vertices.
 
int getConvexHullPointCount () const
 Source point count for a convex hull, or zero for another kind.
 
int getConvexHullMaxVertices () const
 Current convex-hull simplification budget, or zero for another kind.
 
void setTriangleMeshData (const std::vector< float > &vertices, const std::vector< int32_t > &indices, bool weldVertices=true, float weldTolerance=0.001f, bool identifyEdges=true, bool useMedianSplit=false)
 Atomically replaces static triangle-mesh source data and rebuilds its BVH.
 
int getTriangleMeshVertexCount () const
 Source vertex count for a triangle mesh, or zero.
 
int getTriangleMeshTriangleCount () const
 Source triangle count for a triangle mesh, or zero.
 
void setTriangleMeshMaterialIndices (const std::vector< int32_t > &materialIndices)
 Atomically assigns one material-slot index per source mesh triangle.
 
int getTriangleMeshMaterialIndex (int triangleIndex) const
 Material-slot index assigned to a source triangle.
 
int getTriangleMeshMaterialCount () const
 Number of material slots on a triangle mesh, otherwise zero.
 
void setTriangleMeshMaterial (int slot, float friction, float restitution, float rollingResistance, float tangentX, float tangentY, float tangentZ, int materialId, const std::string &frictionMode, const std::string &restitutionMode)
 Replaces one triangle-mesh material slot without rebuilding geometry.
 
float getTriangleMeshMaterialFriction (int slot) const
 Friction of a triangle-mesh material slot.
 
float getTriangleMeshMaterialRestitution (int slot) const
 Restitution of a triangle-mesh material slot.
 
float getTriangleMeshMaterialRollingResistance (int slot) const
 Rolling resistance of a triangle-mesh material slot.
 
int getTriangleMeshMaterialId (int slot) const
 Application material ID of a triangle-mesh material slot.
 
void setHeightFieldHeights (const std::vector< float > &heights)
 Atomically replaces every source height and rebuilds compressed terrain data.
 
void setHeightFieldRegion (int x, int z, int width, int depth, const std::vector< float > &heights)
 Atomically updates a rectangular sample region in row-major order.
 
float getHeightFieldHeight (int x, int z) const
 Source height at a grid sample.
 
int getHeightFieldCountX () const
 Height-field sample count along local X, or zero.
 
int getHeightFieldCountZ () const
 Height-field sample count along local Z, or zero.
 
float getHeightFieldCellSizeX () const
 Height-field cell spacing along local X, or zero.
 
float getHeightFieldCellSizeZ () const
 Height-field cell spacing along local Z, or zero.
 
float getHeightFieldGlobalMin () const
 Height-field shared quantization minimum, or zero.
 
float getHeightFieldGlobalMax () const
 Height-field shared quantization maximum, or zero.
 
float getBoxWidth () const
 Full box width, or zero for another geometry kind.
 
float getBoxHeight () const
 Full box height, or zero for another geometry kind.
 
float getBoxDepth () const
 Full box depth, or zero for another geometry kind.
 
float getRadius () const
 Sphere/capsule radius, or zero for a box.
 
float getCapsuleHeight () const
 Capsule hemisphere-center distance, or zero for another kind.
 
void setOneWay (float nx, float ny, float nz, float planeOffset, float margin, float minNormalDot)
 Enables a one-way collision plane in shape-local space.
 
void disableOneWay ()
 Disables one-way filtering and restores ordinary two-sided collision.
 
bool isOneWay () const
 Whether one-way pre-solve filtering is requested.
 
void setLocalTransform (float px, float py, float pz, float qx, float qy, float qz, float qw)
 Atomically sets the shape transform relative to its Body3D.
 
void setLocalPosition (float x, float y, float z)
 Sets local translation while preserving local rotation.
 
void setLocalRotation (float qx, float qy, float qz, float qw)
 Sets local rotation while preserving local translation.
 
float getLocalX () const
 Local translation X in meters.
 
float getLocalY () const
 Local translation Y in meters.
 
float getLocalZ () const
 Local translation Z in meters.
 
float getLocalRotX () const
 Normalized local quaternion X.
 
float getLocalRotY () const
 Normalized local quaternion Y.
 
float getLocalRotZ () const
 Normalized local quaternion Z.
 
float getLocalRotW () const
 Normalized local quaternion scalar component.
 
void setSensor (bool sensor)
 Sensor shapes report contacts but never collide.
 
bool isSensor () const
 
void setFriction (float friction)
 Material properties.
 
float getFriction () const
 
void setRestitution (float restitution)
 
float getRestitution () const
 
void setRollingResistance (float resistance)
 Rolling resistance coefficient, finite and non-negative.
 
float getRollingResistance () const
 Current rolling resistance; physically affects spheres and capsules.
 
void setTangentVelocity (float x, float y, float z)
 Sets local-space conveyor velocity projected onto contact surfaces.
 
float getTangentVelocityX () const
 Local-space conveyor velocity X component.
 
float getTangentVelocityY () const
 Local-space conveyor velocity Y component.
 
float getTangentVelocityZ () const
 Local-space conveyor velocity Z component.
 
void setMaterialId (int id)
 Sets a low-32-bit application material identifier exposed by native queries.
 
int getMaterialId () const
 Low-32-bit application material identifier.
 
void setExplosionScale (float scale)
 Sets non-negative multiplier applied to geometry-aware explosion impulses.
 
float getExplosionScale () const
 Current explosion impulse multiplier; zero opts this shape out.
 
void setFrictionCombineMode (const std::string &mode)
 Sets friction combine mode: default, average, minimum, multiply, or maximum.
 
std::string getFrictionCombineMode () const
 Current friction combine mode.
 
void setRestitutionCombineMode (const std::string &mode)
 Sets restitution combine mode: default, average, minimum, multiply, or maximum.
 
std::string getRestitutionCombineMode () const
 Current restitution combine mode.
 
void setDensity (float density)
 
float getDensity () const
 
void setFilterBits (uint64_t categoryBits, uint64_t maskBits)
 Collision filter bits used by world ray/query filters (Box3D b3Filter). categoryBits 声明本形状属于哪些类别;maskBits 声明本形状接受哪些类别碰撞。
 
uint64_t getCategoryBits () const
 
void setCategoryBits (uint64_t bits)
 Sets collision category bits without changing the mask.
 
void setMaskBits (uint64_t bits)
 Sets collision mask bits without changing the category.
 
uint64_t getMaskBits () const
 Current 64-bit collision mask.
 
void setGroupIndex (int index)
 Collision group; negative never collides, positive always collides.
 
int getGroupIndex () const
 
Body3D * getBody ()
 Returns the owning body, or null after invalidation.
 
const Body3D * getBody () const
 Returns the owning body for read-only link construction.
 
bool testPoint (float x, float y, float z) const
 Point-in-shape test in world meters.
 
void destroy ()
 Destroys the shape inside its world.
 
b3ShapeId raw () const
 Raw Box3D shape id / liveness.
 
bool isValid () const
 
void invalidate ()
 Internal: marks the wrapper invalid after destruction.
 

友元

class World3D
 
class Body3D
 
struct WorldSnapshotAccess
 

详细描述

3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Shape; owned by the world.

在文件 Shape3D.h 第 25 行定义.

成员枚举类型说明

◆ Kind

enum class eve::physics::Shape3D::Kind
strong

Shape geometry kind.

枚举值
Box 
Sphere 
Capsule 
ConvexHull 
TriangleMesh 
HeightField 

在文件 Shape3D.h 第 28 行定义.

构造及析构函数说明

◆ Shape3D() [1/2]

eve::physics::Shape3D::Shape3D ( World3D *  world,
Body3D *  body,
b3ShapeId  shapeId,
PhysicsShapeHandle  runtimeHandle,
Kind  kind,
float  a,
float  b,
float  c,
std::vector< float >  hullVertices = {},
int  hullMaxVertices = 64,
std::vector< float >  meshVertices = {},
std::vector< int32_t >  meshIndices = {},
b3MeshData *  meshData = nullptr,
bool  meshWeldVertices = true,
float  meshWeldTolerance = 0.001f,
bool  meshIdentifyEdges = true,
bool  meshUseMedianSplit = false,
std::vector< float >  heightValues = {},
int  heightCountX = 0,
int  heightCountZ = 0,
float  heightCellSizeX = 1.f,
float  heightCellSizeZ = 1.f,
float  heightGlobalMin = 0.f,
float  heightGlobalMax = 0.f,
bool  heightClockwise = false,
b3HeightFieldData *  heightData = nullptr 
)

Internal: wraps a Box3D shape (use Body3D::new*Shape).

在文件 Shape3D.cpp 第 166 行定义.

引用了 isValid(), eve::physics::World3D::registerShapeHandle() , 以及 TriangleMesh.

◆ ~Shape3D()

◆ Shape3D() [2/2]

eve::physics::Shape3D::Shape3D ( const Shape3D &  )
delete

成员函数说明

◆ areHitEventsEnabled()

bool eve::physics::Shape3D::areHitEventsEnabled ( ) const

Whether significant collision hit events are enabled.

在文件 Shape3D.cpp 第 394 行定义.

◆ destroy()

void eve::physics::Shape3D::destroy ( )

◆ disableOneWay()

void eve::physics::Shape3D::disableOneWay ( )

Disables one-way filtering and restores ordinary two-sided collision.

在文件 Shape3D.cpp 第 422 行定义.

引用了 isValid().

◆ getBody() [1/2]

Body3D * eve::physics::Shape3D::getBody ( )
inline

Returns the owning body, or null after invalidation.

返回
Borrowed nullable Body3D pointer owned by the physics world. @ownership Shape3D does not own the body; callers must not delete it. @lifetime Valid until body/world destruction; use a PhysicsBodyHandle across frames. @thread Call on the owning physics thread. @reentrancy The accessor invokes no callbacks and is invalid across world mutation.

在文件 Shape3D.h 第 284 行定义.

被这些函数引用 eve::physics::World3D::isShapePairCollisionEnabled() , 以及 eve::physics::World3D::setShapePairCollisionEnabled().

◆ getBody() [2/2]

const Body3D * eve::physics::Shape3D::getBody ( ) const
inline

Returns the owning body for read-only link construction.

返回
Borrowed nullable Body3D pointer owned by the physics world. @ownership Shape3D does not own the body; callers must not delete it. @lifetime Valid until body/world destruction; use a PhysicsBodyHandle across frames. @thread Call on the owning physics thread. @reentrancy The accessor invokes no callbacks and is invalid across world mutation.

在文件 Shape3D.h 第 293 行定义.

◆ getBoxDepth()

float eve::physics::Shape3D::getBoxDepth ( ) const
inline

Full box depth, or zero for another geometry kind.

在文件 Shape3D.h 第 165 行定义.

◆ getBoxHeight()

float eve::physics::Shape3D::getBoxHeight ( ) const
inline

Full box height, or zero for another geometry kind.

在文件 Shape3D.h 第 163 行定义.

◆ getBoxWidth()

float eve::physics::Shape3D::getBoxWidth ( ) const
inline

Full box width, or zero for another geometry kind.

在文件 Shape3D.h 第 161 行定义.

◆ getCapsuleHeight()

float eve::physics::Shape3D::getCapsuleHeight ( ) const
inline

Capsule hemisphere-center distance, or zero for another kind.

在文件 Shape3D.h 第 171 行定义.

◆ getCategoryBits()

uint64_t eve::physics::Shape3D::getCategoryBits ( ) const

在文件 Shape3D.cpp 第 899 行定义.

引用了 isValid().

◆ getConvexHullMaxVertices()

int eve::physics::Shape3D::getConvexHullMaxVertices ( ) const
inline

Current convex-hull simplification budget, or zero for another kind.

在文件 Shape3D.h 第 82 行定义.

◆ getConvexHullPointCount()

int eve::physics::Shape3D::getConvexHullPointCount ( ) const
inline

Source point count for a convex hull, or zero for another kind.

在文件 Shape3D.h 第 78 行定义.

◆ getDensity()

float eve::physics::Shape3D::getDensity ( ) const

在文件 Shape3D.cpp 第 889 行定义.

引用了 isValid().

◆ getExplosionScale()

float eve::physics::Shape3D::getExplosionScale ( ) const
inline

Current explosion impulse multiplier; zero opts this shape out.

在文件 Shape3D.h 第 249 行定义.

◆ getFriction()

float eve::physics::Shape3D::getFriction ( ) const

在文件 Shape3D.cpp 第 781 行定义.

引用了 isValid().

被这些函数引用 getTriangleMeshMaterialFriction().

◆ getFrictionCombineMode()

std::string eve::physics::Shape3D::getFrictionCombineMode ( ) const

Current friction combine mode.

在文件 Shape3D.cpp 第 846 行定义.

引用了 isValid().

◆ getGroupIndex()

int eve::physics::Shape3D::getGroupIndex ( ) const

在文件 Shape3D.cpp 第 928 行定义.

引用了 isValid().

◆ getHeightFieldCellSizeX()

float eve::physics::Shape3D::getHeightFieldCellSizeX ( ) const
inline

Height-field cell spacing along local X, or zero.

在文件 Shape3D.h 第 145 行定义.

◆ getHeightFieldCellSizeZ()

float eve::physics::Shape3D::getHeightFieldCellSizeZ ( ) const
inline

Height-field cell spacing along local Z, or zero.

在文件 Shape3D.h 第 149 行定义.

◆ getHeightFieldCountX()

int eve::physics::Shape3D::getHeightFieldCountX ( ) const
inline

Height-field sample count along local X, or zero.

在文件 Shape3D.h 第 141 行定义.

◆ getHeightFieldCountZ()

int eve::physics::Shape3D::getHeightFieldCountZ ( ) const
inline

Height-field sample count along local Z, or zero.

在文件 Shape3D.h 第 143 行定义.

◆ getHeightFieldGlobalMax()

float eve::physics::Shape3D::getHeightFieldGlobalMax ( ) const
inline

Height-field shared quantization maximum, or zero.

在文件 Shape3D.h 第 157 行定义.

◆ getHeightFieldGlobalMin()

float eve::physics::Shape3D::getHeightFieldGlobalMin ( ) const
inline

Height-field shared quantization minimum, or zero.

在文件 Shape3D.h 第 153 行定义.

◆ getHeightFieldHeight()

float eve::physics::Shape3D::getHeightFieldHeight ( int  x,
int  z 
) const

Source height at a grid sample.

在文件 Shape3D.cpp 第 719 行定义.

引用了 HeightField, x , 以及 z.

◆ getId()

int eve::physics::Shape3D::getId ( ) const
inline

Stable world-local id, preserved when sensor state recreates the backend shape.

在文件 Shape3D.h 第 44 行定义.

被这些函数引用 eve::physics::World3D::isShapePairCollisionEnabled(), eve::physics::World3D::queryBodyContacts() , 以及 eve::physics::World3D::setShapePairCollisionEnabled().

◆ getKind()

std::string eve::physics::Shape3D::getKind ( ) const

Kind name including primitives, "convexHull", "triangleMesh", or "heightField".

在文件 Shape3D.cpp 第 457 行定义.

引用了 Box, Capsule, ConvexHull, HeightField, Sphere , 以及 TriangleMesh.

◆ getLocalRotW()

float eve::physics::Shape3D::getLocalRotW ( ) const
inline

Normalized local quaternion scalar component.

在文件 Shape3D.h 第 217 行定义.

◆ getLocalRotX()

float eve::physics::Shape3D::getLocalRotX ( ) const
inline

Normalized local quaternion X.

在文件 Shape3D.h 第 211 行定义.

◆ getLocalRotY()

float eve::physics::Shape3D::getLocalRotY ( ) const
inline

Normalized local quaternion Y.

在文件 Shape3D.h 第 213 行定义.

◆ getLocalRotZ()

float eve::physics::Shape3D::getLocalRotZ ( ) const
inline

Normalized local quaternion Z.

在文件 Shape3D.h 第 215 行定义.

◆ getLocalX()

float eve::physics::Shape3D::getLocalX ( ) const
inline

Local translation X in meters.

在文件 Shape3D.h 第 205 行定义.

◆ getLocalY()

float eve::physics::Shape3D::getLocalY ( ) const
inline

Local translation Y in meters.

在文件 Shape3D.h 第 207 行定义.

◆ getLocalZ()

float eve::physics::Shape3D::getLocalZ ( ) const
inline

Local translation Z in meters.

在文件 Shape3D.h 第 209 行定义.

◆ getMaskBits()

uint64_t eve::physics::Shape3D::getMaskBits ( ) const

Current 64-bit collision mask.

在文件 Shape3D.cpp 第 917 行定义.

引用了 isValid().

◆ getMaterialId()

int eve::physics::Shape3D::getMaterialId ( ) const

Low-32-bit application material identifier.

在文件 Shape3D.cpp 第 867 行定义.

引用了 isValid().

◆ getRadius()

float eve::physics::Shape3D::getRadius ( ) const
inline

Sphere/capsule radius, or zero for a box.

在文件 Shape3D.h 第 167 行定义.

◆ getRestitution()

float eve::physics::Shape3D::getRestitution ( ) const

在文件 Shape3D.cpp 第 790 行定义.

引用了 isValid().

被这些函数引用 getTriangleMeshMaterialRestitution().

◆ getRestitutionCombineMode()

std::string eve::physics::Shape3D::getRestitutionCombineMode ( ) const

Current restitution combine mode.

在文件 Shape3D.cpp 第 861 行定义.

引用了 isValid().

◆ getRollingResistance()

float eve::physics::Shape3D::getRollingResistance ( ) const

Current rolling resistance; physically affects spheres and capsules.

在文件 Shape3D.cpp 第 804 行定义.

引用了 isValid().

被这些函数引用 getTriangleMeshMaterialRollingResistance().

◆ getTag()

int eve::physics::Shape3D::getTag ( ) const
inline

User-defined integer tag, zero by default.

在文件 Shape3D.h 第 50 行定义.

被这些函数引用 eve::physics::World3D::queryBodyContacts().

◆ getTangentVelocityX()

float eve::physics::Shape3D::getTangentVelocityX ( ) const

Local-space conveyor velocity X component.

在文件 Shape3D.cpp 第 817 行定义.

引用了 isValid().

◆ getTangentVelocityY()

float eve::physics::Shape3D::getTangentVelocityY ( ) const

Local-space conveyor velocity Y component.

在文件 Shape3D.cpp 第 821 行定义.

引用了 isValid().

◆ getTangentVelocityZ()

float eve::physics::Shape3D::getTangentVelocityZ ( ) const

Local-space conveyor velocity Z component.

在文件 Shape3D.cpp 第 825 行定义.

引用了 isValid().

◆ getTriangleMeshMaterialCount()

int eve::physics::Shape3D::getTriangleMeshMaterialCount ( ) const

Number of material slots on a triangle mesh, otherwise zero.

在文件 Shape3D.cpp 第 618 行定义.

引用了 TriangleMesh.

被这些函数引用 getTriangleMeshMaterialFriction(), getTriangleMeshMaterialId(), getTriangleMeshMaterialRestitution(), getTriangleMeshMaterialRollingResistance() , 以及 setTriangleMeshMaterial().

◆ getTriangleMeshMaterialFriction()

float eve::physics::Shape3D::getTriangleMeshMaterialFriction ( int  slot) const

Friction of a triangle-mesh material slot.

在文件 Shape3D.cpp 第 653 行定义.

引用了 getFriction(), getTriangleMeshMaterialCount() , 以及 TriangleMesh.

◆ getTriangleMeshMaterialId()

int eve::physics::Shape3D::getTriangleMeshMaterialId ( int  slot) const

Application material ID of a triangle-mesh material slot.

在文件 Shape3D.cpp 第 673 行定义.

引用了 getTriangleMeshMaterialCount(), id , 以及 TriangleMesh.

◆ getTriangleMeshMaterialIndex()

int eve::physics::Shape3D::getTriangleMeshMaterialIndex ( int  triangleIndex) const

Material-slot index assigned to a source triangle.

在文件 Shape3D.cpp 第 608 行定义.

引用了 TriangleMesh.

◆ getTriangleMeshMaterialRestitution()

float eve::physics::Shape3D::getTriangleMeshMaterialRestitution ( int  slot) const

Restitution of a triangle-mesh material slot.

在文件 Shape3D.cpp 第 659 行定义.

引用了 getRestitution(), getTriangleMeshMaterialCount(), restitution , 以及 TriangleMesh.

◆ getTriangleMeshMaterialRollingResistance()

float eve::physics::Shape3D::getTriangleMeshMaterialRollingResistance ( int  slot) const

Rolling resistance of a triangle-mesh material slot.

在文件 Shape3D.cpp 第 665 行定义.

引用了 getRollingResistance(), getTriangleMeshMaterialCount() , 以及 TriangleMesh.

◆ getTriangleMeshTriangleCount()

int eve::physics::Shape3D::getTriangleMeshTriangleCount ( ) const
inline

Source triangle count for a triangle mesh, or zero.

在文件 Shape3D.h 第 98 行定义.

◆ getTriangleMeshVertexCount()

int eve::physics::Shape3D::getTriangleMeshVertexCount ( ) const
inline

Source vertex count for a triangle mesh, or zero.

在文件 Shape3D.h 第 94 行定义.

◆ invalidate()

void eve::physics::Shape3D::invalidate ( )

Internal: marks the wrapper invalid after destruction.

在文件 Shape3D.cpp 第 231 行定义.

引用了 eve::physics::World3D::forgetShape(), eve::RuntimeHandle< PhysicsShapeHandleTag >::invalid() , 以及 isValid().

被这些函数引用 destroy().

◆ isOneWay()

bool eve::physics::Shape3D::isOneWay ( ) const
inline

Whether one-way pre-solve filtering is requested.

在文件 Shape3D.h 第 187 行定义.

◆ isSensor()

◆ isValid()

◆ operator=()

Shape3D & eve::physics::Shape3D::operator= ( const Shape3D &  )
delete

◆ raw()

b3ShapeId eve::physics::Shape3D::raw ( ) const
inline

Raw Box3D shape id / liveness.

在文件 Shape3D.h 第 302 行定义.

◆ runtimeHandle()

PhysicsShapeHandle eve::physics::Shape3D::runtimeHandle ( ) const
inlinenoexcept

Process-local generation-qualified handle owned by World3D.

在文件 Shape3D.h 第 46 行定义.

◆ setBoxSize()

void eve::physics::Shape3D::setBoxSize ( float  width,
float  height,
float  depth 
)

Atomically changes full box dimensions in meters.

异常
eve::Exceptionon wrong kind or invalid size.

在文件 Shape3D.cpp 第 469 行定义.

引用了 Box, depth, halfHeight, halfWidth, height, isSensor(), eve::physics::Body3D::isValid() , 以及 width.

◆ setCapsuleSize()

void eve::physics::Shape3D::setCapsuleSize ( float  height,
float  radius 
)

Atomically changes capsule segment height and radius in meters.

参数
heightDistance between hemisphere centers; may be zero.
radiusPositive hemisphere radius.
异常
eve::Exceptionon wrong kind or invalid dimensions.

在文件 Shape3D.cpp 第 501 行定义.

引用了 Capsule, halfHeight, height, isSensor(), eve::physics::Body3D::isValid() , 以及 radius.

◆ setCategoryBits()

void eve::physics::Shape3D::setCategoryBits ( uint64_t  bits)

Sets collision category bits without changing the mask.

在文件 Shape3D.cpp 第 903 行定义.

引用了 filter , 以及 isValid().

◆ setConvexHullVertices()

void eve::physics::Shape3D::setConvexHullVertices ( const std::vector< float > &  vertices,
int  maxVertices = 64 
)

Atomically rebuilds a convex hull from packed local XYZ vertices.

参数
verticesAt least four finite, non-coplanar points.
maxVerticesHull simplification budget in [4, 254].
异常
eve::Exceptionon another shape kind, malformed, or degenerate input.

在文件 Shape3D.cpp 第 518 行定义.

引用了 ConvexHull, isSensor(), eve::physics::Body3D::isValid() , 以及 vertices.

◆ setDensity()

void eve::physics::Shape3D::setDensity ( float  density)

在文件 Shape3D.cpp 第 882 行定义.

引用了 isValid().

◆ setExplosionScale()

void eve::physics::Shape3D::setExplosionScale ( float  scale)

Sets non-negative multiplier applied to geometry-aware explosion impulses.

在文件 Shape3D.cpp 第 874 行定义.

引用了 isSensor(), eve::physics::Body3D::isValid() , 以及 scale.

◆ setFilterBits()

void eve::physics::Shape3D::setFilterBits ( uint64_t  categoryBits,
uint64_t  maskBits 
)

Collision filter bits used by world ray/query filters (Box3D b3Filter). categoryBits 声明本形状属于哪些类别;maskBits 声明本形状接受哪些类别碰撞。

在文件 Shape3D.cpp 第 891 行定义.

引用了 filter , 以及 isValid().

被这些函数引用 eve::vehicle::VehiclePhysics::attach3D().

◆ setFriction()

void eve::physics::Shape3D::setFriction ( float  friction)

Material properties.

在文件 Shape3D.cpp 第 774 行定义.

引用了 isValid().

◆ setFrictionCombineMode()

void eve::physics::Shape3D::setFrictionCombineMode ( const std::string &  mode)

Sets friction combine mode: default, average, minimum, multiply, or maximum.

在文件 Shape3D.cpp 第 837 行定义.

引用了 isValid() , 以及 material.

◆ setGroupIndex()

void eve::physics::Shape3D::setGroupIndex ( int  index)

Collision group; negative never collides, positive always collides.

在文件 Shape3D.cpp 第 921 行定义.

引用了 filter, index , 以及 isValid().

◆ setHeightFieldHeights()

void eve::physics::Shape3D::setHeightFieldHeights ( const std::vector< float > &  heights)

Atomically replaces every source height and rebuilds compressed terrain data.

在文件 Shape3D.cpp 第 682 行定义.

引用了 HeightField, isSensor() , 以及 eve::physics::Body3D::isValid().

被这些函数引用 setHeightFieldRegion().

◆ setHeightFieldRegion()

void eve::physics::Shape3D::setHeightFieldRegion ( int  x,
int  z,
int  width,
int  depth,
const std::vector< float > &  heights 
)

Atomically updates a rectangular sample region in row-major order.

在文件 Shape3D.cpp 第 698 行定义.

引用了 column, depth, HeightField, setHeightFieldHeights(), updated, width, x , 以及 z.

◆ setHitEventsEnabled()

void eve::physics::Shape3D::setHitEventsEnabled ( bool  enabled)

Enables significant collision hit events for this shape.

在文件 Shape3D.cpp 第 388 行定义.

引用了 enabled, isSensor() , 以及 isValid().

◆ setLocalPosition()

void eve::physics::Shape3D::setLocalPosition ( float  x,
float  y,
float  z 
)

Sets local translation while preserving local rotation.

在文件 Shape3D.cpp 第 764 行定义.

引用了 setLocalTransform(), x, y , 以及 z.

◆ setLocalRotation()

void eve::physics::Shape3D::setLocalRotation ( float  qx,
float  qy,
float  qz,
float  qw 
)

Sets local rotation while preserving local translation.

在文件 Shape3D.cpp 第 768 行定义.

引用了 qw, qx, qy, qz , 以及 setLocalTransform().

◆ setLocalTransform()

void eve::physics::Shape3D::setLocalTransform ( float  px,
float  py,
float  pz,
float  qx,
float  qy,
float  qz,
float  qw 
)

Atomically sets the shape transform relative to its Body3D.

参数
pxLocal translation X in meters.
pyLocal translation Y in meters.
pzLocal translation Z in meters.
qxQuaternion X component, normalized internally.
qyQuaternion Y component.
qzQuaternion Z component.
qwQuaternion scalar component.

在文件 Shape3D.cpp 第 728 行定义.

引用了 HeightField, isSensor(), eve::physics::Body3D::isValid(), px, py, pz, qw, qx, qy , 以及 qz.

被这些函数引用 setLocalPosition() , 以及 setLocalRotation().

◆ setMaskBits()

void eve::physics::Shape3D::setMaskBits ( uint64_t  bits)

Sets collision mask bits without changing the category.

在文件 Shape3D.cpp 第 910 行定义.

引用了 filter , 以及 isValid().

◆ setMaterialId()

void eve::physics::Shape3D::setMaterialId ( int  id)

Sets a low-32-bit application material identifier exposed by native queries.

在文件 Shape3D.cpp 第 829 行定义.

引用了 isValid() , 以及 material.

◆ setOneWay()

void eve::physics::Shape3D::setOneWay ( float  nx,
float  ny,
float  nz,
float  planeOffset,
float  margin,
float  minNormalDot 
)

Enables a one-way collision plane in shape-local space.

参数
nxLocal allowed-side normal X; normalized internally.
nyLocal allowed-side normal Y.
nzLocal allowed-side normal Z.
planeOffsetPlane distance from the shape origin along the normal, in meters.
marginAllowed-side positional tolerance in meters, finite and non-negative.
minNormalDotMinimum contact/outward-normal dot in [-1,1].

在文件 Shape3D.cpp 第 398 行定义.

引用了 isSensor(), isValid(), margin, nx, ny , 以及 nz.

◆ setRestitution()

void eve::physics::Shape3D::setRestitution ( float  restitution)

在文件 Shape3D.cpp 第 783 行定义.

引用了 isValid() , 以及 restitution.

◆ setRestitutionCombineMode()

void eve::physics::Shape3D::setRestitutionCombineMode ( const std::string &  mode)

Sets restitution combine mode: default, average, minimum, multiply, or maximum.

在文件 Shape3D.cpp 第 852 行定义.

引用了 isValid() , 以及 material.

◆ setRollingResistance()

void eve::physics::Shape3D::setRollingResistance ( float  resistance)

Rolling resistance coefficient, finite and non-negative.

在文件 Shape3D.cpp 第 794 行定义.

引用了 isValid() , 以及 material.

◆ setSensor()

void eve::physics::Shape3D::setSensor ( bool  sensor)

Sensor shapes report contacts but never collide.

在文件 Shape3D.cpp 第 371 行定义.

引用了 eve::physics::Body3D::isValid() , 以及 isValid().

◆ setSphereRadius()

void eve::physics::Shape3D::setSphereRadius ( float  radius)

Atomically changes sphere radius in meters.

异常
eve::Exceptionon wrong kind or invalid radius.

在文件 Shape3D.cpp 第 488 行定义.

引用了 isSensor(), eve::physics::Body3D::isValid(), radius , 以及 Sphere.

◆ setTag()

void eve::physics::Shape3D::setTag ( int  tag)

User-defined integer tag preserved for the wrapper lifetime.

在文件 Shape3D.cpp 第 383 行定义.

引用了 tag , 以及 eve::physics::World3D::updateShapeTag().

◆ setTangentVelocity()

void eve::physics::Shape3D::setTangentVelocity ( float  x,
float  y,
float  z 
)

Sets local-space conveyor velocity projected onto contact surfaces.

在文件 Shape3D.cpp 第 808 行定义.

引用了 isValid(), material, x, y , 以及 z.

◆ setTriangleMeshData()

void eve::physics::Shape3D::setTriangleMeshData ( const std::vector< float > &  vertices,
const std::vector< int32_t > &  indices,
bool  weldVertices = true,
float  weldTolerance = 0.001f,
bool  identifyEdges = true,
bool  useMedianSplit = false 
)

Atomically replaces static triangle-mesh source data and rebuilds its BVH.

异常
eve::Exceptionon another kind, invalid data, or non-static Body.

在文件 Shape3D.cpp 第 533 行定义.

引用了 indices, isSensor(), eve::physics::Body3D::isValid(), eve::physics::Body3D::raw(), TriangleMesh , 以及 vertices.

◆ setTriangleMeshMaterial()

void eve::physics::Shape3D::setTriangleMeshMaterial ( int  slot,
float  friction,
float  restitution,
float  rollingResistance,
float  tangentX,
float  tangentY,
float  tangentZ,
int  materialId,
const std::string &  frictionMode,
const std::string &  restitutionMode 
)

Replaces one triangle-mesh material slot without rebuilding geometry.

参数
slotMaterial slot in [0, materialCount).
frictionFinite non-negative Coulomb friction.
restitutionFinite non-negative restitution.
rollingResistanceFinite non-negative rolling resistance.
tangentXLocal conveyor velocity X.
tangentYLocal conveyor velocity Y.
tangentZLocal conveyor velocity Z.
materialIdLow-32-bit application material identifier.
frictionModeCombine mode name.
restitutionModeCombine mode name.

在文件 Shape3D.cpp 第 622 行定义.

引用了 getTriangleMeshMaterialCount(), isValid(), material, restitution , 以及 TriangleMesh.

◆ setTriangleMeshMaterialIndices()

void eve::physics::Shape3D::setTriangleMeshMaterialIndices ( const std::vector< int32_t > &  materialIndices)

Atomically assigns one material-slot index per source mesh triangle.

在文件 Shape3D.cpp 第 568 行定义.

引用了 index, isSensor() , 以及 TriangleMesh.

◆ testPoint()

bool eve::physics::Shape3D::testPoint ( float  x,
float  y,
float  z 
) const

Point-in-shape test in world meters.

在文件 Shape3D.cpp 第 932 行定义.

引用了 Box, Capsule, ConvexHull, HeightField, eve::physics::Body3D::isValid(), isValid(), mesh, point, eve::physics::Body3D::raw(), Sphere, TriangleMesh, x, y , 以及 z.

友元及相关函数文档

◆ Body3D

friend class Body3D
friend

在文件 Shape3D.h 第 310 行定义.

◆ World3D

friend class World3D
friend

在文件 Shape3D.h 第 309 行定义.

◆ WorldSnapshotAccess

friend struct WorldSnapshotAccess
friend

在文件 Shape3D.h 第 311 行定义.


该类的文档由以下文件生成: