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.
成员枚举类型说明
◆ Kind
|
strong |
构造及析构函数说明
◆ 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()
| eve::physics::Shape3D::~Shape3D | ( | ) |
◆ Shape3D() [2/2]
|
delete |
成员函数说明
◆ areHitEventsEnabled()
| bool eve::physics::Shape3D::areHitEventsEnabled | ( | ) | const |
Whether significant collision hit events are enabled.
在文件 Shape3D.cpp 第 394 行定义.
◆ destroy()
| void eve::physics::Shape3D::destroy | ( | ) |
Destroys the shape inside its world.
在文件 Shape3D.cpp 第 240 行定义.
引用了 eve::physics::World3D::forgetShape(), eve::RuntimeHandle< PhysicsShapeHandleTag >::invalid(), invalidate(), eve::physics::Body3D::isValid() , 以及 isValid().
◆ disableOneWay()
| void eve::physics::Shape3D::disableOneWay | ( | ) |
Disables one-way filtering and restores ordinary two-sided collision.
在文件 Shape3D.cpp 第 422 行定义.
引用了 isValid().
◆ getBody() [1/2]
|
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.
被这些函数引用 eve::physics::World3D::isShapePairCollisionEnabled() , 以及 eve::physics::World3D::setShapePairCollisionEnabled().
◆ getBody() [2/2]
|
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.
◆ getBoxDepth()
|
inline |
◆ getBoxHeight()
|
inline |
◆ getBoxWidth()
|
inline |
◆ getCapsuleHeight()
|
inline |
◆ getCategoryBits()
| uint64_t eve::physics::Shape3D::getCategoryBits | ( | ) | const |
在文件 Shape3D.cpp 第 899 行定义.
引用了 isValid().
◆ getConvexHullMaxVertices()
|
inline |
◆ getConvexHullPointCount()
|
inline |
◆ getDensity()
| float eve::physics::Shape3D::getDensity | ( | ) | const |
在文件 Shape3D.cpp 第 889 行定义.
引用了 isValid().
◆ getExplosionScale()
|
inline |
◆ getFriction()
| float eve::physics::Shape3D::getFriction | ( | ) | const |
◆ getFrictionCombineMode()
| std::string eve::physics::Shape3D::getFrictionCombineMode | ( | ) | const |
◆ getGroupIndex()
| int eve::physics::Shape3D::getGroupIndex | ( | ) | const |
在文件 Shape3D.cpp 第 928 行定义.
引用了 isValid().
◆ getHeightFieldCellSizeX()
|
inline |
◆ getHeightFieldCellSizeZ()
|
inline |
◆ getHeightFieldCountX()
|
inline |
◆ getHeightFieldCountZ()
|
inline |
◆ getHeightFieldGlobalMax()
|
inline |
◆ getHeightFieldGlobalMin()
|
inline |
◆ getHeightFieldHeight()
| float eve::physics::Shape3D::getHeightFieldHeight | ( | int | x, |
| int | z | ||
| ) | const |
◆ getId()
|
inline |
Stable world-local id, preserved when sensor state recreates the backend shape.
被这些函数引用 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()
|
inline |
◆ getLocalRotX()
|
inline |
◆ getLocalRotY()
|
inline |
◆ getLocalRotZ()
|
inline |
◆ getLocalX()
|
inline |
◆ getLocalY()
|
inline |
◆ getLocalZ()
|
inline |
◆ getMaskBits()
| uint64_t eve::physics::Shape3D::getMaskBits | ( | ) | const |
◆ getMaterialId()
| int eve::physics::Shape3D::getMaterialId | ( | ) | const |
◆ getRadius()
|
inline |
◆ getRestitution()
| float eve::physics::Shape3D::getRestitution | ( | ) | const |
◆ getRestitutionCombineMode()
| std::string eve::physics::Shape3D::getRestitutionCombineMode | ( | ) | const |
◆ getRollingResistance()
| float eve::physics::Shape3D::getRollingResistance | ( | ) | const |
Current rolling resistance; physically affects spheres and capsules.
在文件 Shape3D.cpp 第 804 行定义.
引用了 isValid().
◆ getTag()
|
inline |
User-defined integer tag, zero by default.
◆ getTangentVelocityX()
| float eve::physics::Shape3D::getTangentVelocityX | ( | ) | const |
◆ getTangentVelocityY()
| float eve::physics::Shape3D::getTangentVelocityY | ( | ) | const |
◆ getTangentVelocityZ()
| float eve::physics::Shape3D::getTangentVelocityZ | ( | ) | const |
◆ 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 |
◆ 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()
|
inline |
◆ getTriangleMeshVertexCount()
|
inline |
◆ 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()
|
inline |
◆ isSensor()
| bool eve::physics::Shape3D::isSensor | ( | ) | const |
◆ isValid()
| bool eve::physics::Shape3D::isValid | ( | ) | const |
在文件 Shape3D.cpp 第 229 行定义.
被这些函数引用 destroy(), disableOneWay(), getCategoryBits(), getDensity(), getFriction(), getFrictionCombineMode(), getGroupIndex(), getMaskBits(), getMaterialId(), getRestitution(), getRestitutionCombineMode(), getRollingResistance(), getTangentVelocityX(), getTangentVelocityY(), getTangentVelocityZ(), invalidate(), isSensor(), eve::physics::World3D::isShapePairCollisionEnabled(), setCategoryBits(), setDensity(), setFilterBits(), setFriction(), setFrictionCombineMode(), setGroupIndex(), setHitEventsEnabled(), setMaskBits(), setMaterialId(), setOneWay(), setRestitution(), setRestitutionCombineMode(), setRollingResistance(), setSensor(), eve::physics::World3D::setShapePairCollisionEnabled(), setTangentVelocity(), setTriangleMeshMaterial(), Shape3D(), testPoint() , 以及 ~Shape3D().
◆ operator=()
◆ raw()
|
inline |
◆ runtimeHandle()
|
inlinenoexcept |
◆ setBoxSize()
| void eve::physics::Shape3D::setBoxSize | ( | float | width, |
| float | height, | ||
| float | depth | ||
| ) |
Atomically changes full box dimensions in meters.
- 异常
-
eve::Exception on 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.
- 参数
-
height Distance between hemisphere centers; may be zero. radius Positive hemisphere radius.
- 异常
-
eve::Exception on 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 行定义.
◆ setConvexHullVertices()
| void eve::physics::Shape3D::setConvexHullVertices | ( | const std::vector< float > & | vertices, |
| int | maxVertices = 64 |
||
| ) |
Atomically rebuilds a convex hull from packed local XYZ vertices.
- 参数
-
vertices At least four finite, non-coplanar points. maxVertices Hull simplification budget in [4, 254].
- 异常
-
eve::Exception on 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 行定义.
◆ setFriction()
| void eve::physics::Shape3D::setFriction | ( | float | friction | ) |
◆ setFrictionCombineMode()
| void eve::physics::Shape3D::setFrictionCombineMode | ( | const std::string & | mode | ) |
Sets friction combine mode: default, average, minimum, multiply, or maximum.
在文件 Shape3D.cpp 第 837 行定义.
◆ setGroupIndex()
| void eve::physics::Shape3D::setGroupIndex | ( | int | index | ) |
Collision group; negative never collides, positive always collides.
在文件 Shape3D.cpp 第 921 行定义.
◆ 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.
- 参数
-
px Local translation X in meters. py Local translation Y in meters. pz Local translation Z in meters. qx Quaternion X component, normalized internally. qy Quaternion Y component. qz Quaternion Z component. qw Quaternion 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 行定义.
◆ setMaterialId()
| void eve::physics::Shape3D::setMaterialId | ( | int | id | ) |
Sets a low-32-bit application material identifier exposed by native queries.
在文件 Shape3D.cpp 第 829 行定义.
◆ 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.
- 参数
-
nx Local allowed-side normal X; normalized internally. ny Local allowed-side normal Y. nz Local allowed-side normal Z. planeOffset Plane distance from the shape origin along the normal, in meters. margin Allowed-side positional tolerance in meters, finite and non-negative. minNormalDot Minimum contact/outward-normal dot in [-1,1].
在文件 Shape3D.cpp 第 398 行定义.
◆ 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 行定义.
◆ setRollingResistance()
| void eve::physics::Shape3D::setRollingResistance | ( | float | resistance | ) |
Rolling resistance coefficient, finite and non-negative.
在文件 Shape3D.cpp 第 794 行定义.
◆ 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::Exception on 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 | ||
| ) |
◆ 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::Exception on 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.
- 参数
-
slot Material slot in [0, materialCount). friction Finite non-negative Coulomb friction. restitution Finite non-negative restitution. rollingResistance Finite non-negative rolling resistance. tangentX Local conveyor velocity X. tangentY Local conveyor velocity Y. tangentZ Local conveyor velocity Z. materialId Low-32-bit application material identifier. frictionMode Combine mode name. restitutionMode Combine 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
◆ World3D
◆ WorldSnapshotAccess
|
friend |
该类的文档由以下文件生成:
- src/modules/physics/Shape3D.h
- src/modules/physics/Shape3D.cpp