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 类型 | |
| using | Kind = ShapeKind3D |
| Shape geometry kind. | |
Public 成员函数 | |
| Shape3D (World3D *world, Body3D *body, std::unique_ptr< IShapeBackend3D > backend, PhysicsShapeHandle runtimeHandle, ShapeGeometry3D geometry) | |
| Internal owning constructor used by Body3D shape creation; backend and geometry are consumed. | |
| ~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. | |
| bool | isValid () const |
| Native shape liveness through the selected backend. | |
| void | invalidate () |
| Internal: marks the wrapper invalid after destruction. | |
友元 | |
| class | box3d::WorldBackend |
| class | jolt::WorldBackend |
| struct | box3d::Access |
| class | World3D |
| class | Body3D |
| struct | WorldSnapshotAccess |
| struct | PortableWorldSnapshotAccess |
详细描述
3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Shape; owned by the world.
成员类型定义说明
◆ Kind
构造及析构函数说明
◆ Shape3D() [1/2]
| eve::physics::Shape3D::Shape3D | ( | World3D * | world, |
| Body3D * | body, | ||
| std::unique_ptr< IShapeBackend3D > | backend, | ||
| PhysicsShapeHandle | runtimeHandle, | ||
| ShapeGeometry3D | geometry | ||
| ) |
Internal owning constructor used by Body3D shape creation; backend and geometry are consumed.
在文件 Shape3D.cpp 第 52 行定义.
引用了 count, EV_PARAM_CHECK, eve::physics::ShapeGeometry3D::kind , 以及 eve::physics::World3D::registerShapeHandle().
◆ ~Shape3D()
| eve::physics::Shape3D::~Shape3D | ( | ) |
在文件 Shape3D.cpp 第 68 行定义.
引用了 destroy().
◆ Shape3D() [2/2]
|
delete |
成员函数说明
◆ areHitEventsEnabled()
| bool eve::physics::Shape3D::areHitEventsEnabled | ( | ) | const |
Whether significant collision hit events are enabled.
在文件 Shape3D.cpp 第 130 行定义.
◆ destroy()
| void eve::physics::Shape3D::destroy | ( | ) |
Destroys the shape inside its world.
在文件 Shape3D.cpp 第 77 行定义.
引用了 invalidate().
被这些函数引用 ~Shape3D().
◆ disableOneWay()
| void eve::physics::Shape3D::disableOneWay | ( | ) |
Disables one-way filtering and restores ordinary two-sided collision.
在文件 Shape3D.cpp 第 158 行定义.
引用了 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::jolt::WorldBackend::queryBodyContactsOwned() , 以及 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 第 621 行定义.
◆ getConvexHullMaxVertices()
|
inline |
◆ getConvexHullPointCount()
|
inline |
◆ getDensity()
| float eve::physics::Shape3D::getDensity | ( | ) | const |
在文件 Shape3D.cpp 第 611 行定义.
◆ getExplosionScale()
|
inline |
◆ getFriction()
| float eve::physics::Shape3D::getFriction | ( | ) | const |
在文件 Shape3D.cpp 第 504 行定义.
◆ getFrictionCombineMode()
| std::string eve::physics::Shape3D::getFrictionCombineMode | ( | ) | const |
Current friction combine mode.
在文件 Shape3D.cpp 第 567 行定义.
◆ getGroupIndex()
| int eve::physics::Shape3D::getGroupIndex | ( | ) | const |
在文件 Shape3D.cpp 第 646 行定义.
◆ 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::setShapePairCollisionEnabled().
◆ getKind()
| std::string eve::physics::Shape3D::getKind | ( | ) | const |
Kind name including primitives, "convexHull", "triangleMesh", or "heightField".
在文件 Shape3D.cpp 第 186 行定义.
◆ getLocalRotW()
|
inline |
◆ getLocalRotX()
|
inline |
◆ getLocalRotY()
|
inline |
◆ getLocalRotZ()
|
inline |
◆ getLocalX()
|
inline |
◆ getLocalY()
|
inline |
◆ getLocalZ()
|
inline |
◆ getMaskBits()
| uint64_t eve::physics::Shape3D::getMaskBits | ( | ) | const |
Current 64-bit collision mask.
在文件 Shape3D.cpp 第 637 行定义.
◆ getMaterialId()
| int eve::physics::Shape3D::getMaterialId | ( | ) | const |
Low-32-bit application material identifier.
在文件 Shape3D.cpp 第 586 行定义.
◆ getRadius()
|
inline |
◆ getRestitution()
| float eve::physics::Shape3D::getRestitution | ( | ) | const |
在文件 Shape3D.cpp 第 513 行定义.
◆ getRestitutionCombineMode()
| std::string eve::physics::Shape3D::getRestitutionCombineMode | ( | ) | const |
Current restitution combine mode.
在文件 Shape3D.cpp 第 581 行定义.
◆ getRollingResistance()
| float eve::physics::Shape3D::getRollingResistance | ( | ) | const |
Current rolling resistance; physically affects spheres and capsules.
在文件 Shape3D.cpp 第 525 行定义.
◆ getTag()
|
inline |
◆ getTangentVelocityX()
| float eve::physics::Shape3D::getTangentVelocityX | ( | ) | const |
Local-space conveyor velocity X component.
在文件 Shape3D.cpp 第 538 行定义.
◆ getTangentVelocityY()
| float eve::physics::Shape3D::getTangentVelocityY | ( | ) | const |
Local-space conveyor velocity Y component.
在文件 Shape3D.cpp 第 542 行定义.
◆ getTangentVelocityZ()
| float eve::physics::Shape3D::getTangentVelocityZ | ( | ) | const |
Local-space conveyor velocity Z component.
在文件 Shape3D.cpp 第 546 行定义.
◆ getTriangleMeshMaterialCount()
| int eve::physics::Shape3D::getTriangleMeshMaterialCount | ( | ) | const |
Number of material slots on a triangle mesh, otherwise zero.
在文件 Shape3D.cpp 第 346 行定义.
引用了 eve::physics::ShapeGeometry3D::kind.
被这些函数引用 setTriangleMeshMaterial().
◆ getTriangleMeshMaterialFriction()
| float eve::physics::Shape3D::getTriangleMeshMaterialFriction | ( | int | slot | ) | const |
◆ getTriangleMeshMaterialId()
| int eve::physics::Shape3D::getTriangleMeshMaterialId | ( | int | slot | ) | const |
Application material ID of a triangle-mesh material slot.
在文件 Shape3D.cpp 第 401 行定义.
◆ getTriangleMeshMaterialIndex()
| int eve::physics::Shape3D::getTriangleMeshMaterialIndex | ( | int | triangleIndex | ) | const |
Material-slot index assigned to a source triangle.
在文件 Shape3D.cpp 第 335 行定义.
引用了 eve::physics::ShapeGeometry3D::kind, eve::physics::ShapeGeometry3D::meshIndices , 以及 eve::physics::ShapeGeometry3D::meshMaterialIndices.
◆ getTriangleMeshMaterialRestitution()
| float eve::physics::Shape3D::getTriangleMeshMaterialRestitution | ( | int | slot | ) | const |
◆ getTriangleMeshMaterialRollingResistance()
| float eve::physics::Shape3D::getTriangleMeshMaterialRollingResistance | ( | int | slot | ) | const |
Rolling resistance of a triangle-mesh material slot.
在文件 Shape3D.cpp 第 393 行定义.
引用了 rollingResistance , 以及 slot.
◆ getTriangleMeshTriangleCount()
|
inline |
◆ getTriangleMeshVertexCount()
|
inline |
◆ invalidate()
| void eve::physics::Shape3D::invalidate | ( | ) |
Internal: marks the wrapper invalid after destruction.
在文件 Shape3D.cpp 第 70 行定义.
引用了 eve::physics::World3D::forgetShape() , 以及 eve::RuntimeHandle< PhysicsShapeHandleTag >::invalid().
被这些函数引用 destroy().
◆ isOneWay()
|
inline |
◆ isSensor()
| bool eve::physics::Shape3D::isSensor | ( | ) | const |
◆ isValid()
| bool eve::physics::Shape3D::isValid | ( | ) | const |
Native shape liveness through the selected backend.
在文件 Shape3D.cpp 第 69 行定义.
被这些函数引用 disableOneWay(), eve::physics::World3D::isShapePairCollisionEnabled(), setHitEventsEnabled(), setOneWay(), setSensor() , 以及 eve::physics::World3D::setShapePairCollisionEnabled().
◆ operator=()
◆ 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 第 198 行定义.
引用了 eve::physics::ShapeGeometry3D::a, eve::physics::ShapeGeometry3D::b, eve::physics::ShapeGeometry3D::c, depth, halfWidth, height, isSensor(), eve::physics::Body3D::isValid(), eve::physics::ShapeGeometry3D::kind , 以及 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 第 230 行定义.
引用了 eve::physics::ShapeGeometry3D::a, eve::physics::ShapeGeometry3D::b, height, isSensor(), eve::physics::Body3D::isValid(), eve::physics::ShapeGeometry3D::kind , 以及 radius.
◆ setCategoryBits()
| void eve::physics::Shape3D::setCategoryBits | ( | uint64_t | bits | ) |
◆ 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 第 247 行定义.
引用了 eve::physics::ShapeGeometry3D::hullMaxVertices, eve::physics::ShapeGeometry3D::hullVertices, isSensor(), eve::physics::Body3D::isValid(), eve::physics::ShapeGeometry3D::kind , 以及 vertices.
◆ setDensity()
| void eve::physics::Shape3D::setDensity | ( | float | density | ) |
在文件 Shape3D.cpp 第 604 行定义.
引用了 density.
◆ setExplosionScale()
| void eve::physics::Shape3D::setExplosionScale | ( | float | scale | ) |
Sets non-negative multiplier applied to geometry-aware explosion impulses.
在文件 Shape3D.cpp 第 590 行定义.
◆ 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 第 613 行定义.
引用了 filter.
◆ 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 第 558 行定义.
引用了 material.
◆ setGroupIndex()
| void eve::physics::Shape3D::setGroupIndex | ( | int | index | ) |
Collision group; negative never collides, positive always collides.
在文件 Shape3D.cpp 第 639 行定义.
◆ setHeightFieldHeights()
| void eve::physics::Shape3D::setHeightFieldHeights | ( | const std::vector< float > & | heights | ) |
Atomically replaces every source height and rebuilds compressed terrain data.
在文件 Shape3D.cpp 第 409 行定义.
◆ setHeightFieldRegion()
| void eve::physics::Shape3D::setHeightFieldRegion | ( | int | x, |
| int | z, | ||
| int | width, | ||
| int | depth, | ||
| const std::vector< float > & | heights | ||
| ) |
◆ setHitEventsEnabled()
| void eve::physics::Shape3D::setHitEventsEnabled | ( | bool | enabled | ) |
Enables significant collision hit events for this shape.
在文件 Shape3D.cpp 第 125 行定义.
引用了 enabled, isSensor() , 以及 isValid().
◆ setLocalPosition()
| void eve::physics::Shape3D::setLocalPosition | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
◆ setLocalRotation()
| void eve::physics::Shape3D::setLocalRotation | ( | float | qx, |
| float | qy, | ||
| float | qz, | ||
| float | qw | ||
| ) |
◆ 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 第 450 行定义.
◆ setMaskBits()
| void eve::physics::Shape3D::setMaskBits | ( | uint64_t | bits | ) |
◆ setMaterialId()
| void eve::physics::Shape3D::setMaterialId | ( | int | id | ) |
Sets a low-32-bit application material identifier exposed by native queries.
在文件 Shape3D.cpp 第 550 行定义.
引用了 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.
- 参数
-
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 第 134 行定义.
◆ setRestitution()
| void eve::physics::Shape3D::setRestitution | ( | float | restitution | ) |
在文件 Shape3D.cpp 第 506 行定义.
引用了 restitution.
◆ setRestitutionCombineMode()
| void eve::physics::Shape3D::setRestitutionCombineMode | ( | const std::string & | mode | ) |
Sets restitution combine mode: default, average, minimum, multiply, or maximum.
在文件 Shape3D.cpp 第 572 行定义.
引用了 material.
◆ setRollingResistance()
| void eve::physics::Shape3D::setRollingResistance | ( | float | resistance | ) |
◆ setSensor()
| void eve::physics::Shape3D::setSensor | ( | bool | sensor | ) |
Sensor shapes report contacts but never collide.
在文件 Shape3D.cpp 第 102 行定义.
引用了 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 第 217 行定义.
引用了 eve::physics::ShapeGeometry3D::a, isSensor(), eve::physics::Body3D::isValid(), eve::physics::ShapeGeometry3D::kind , 以及 radius.
◆ setTag()
| void eve::physics::Shape3D::setTag | ( | int | tag | ) |
User-defined integer tag preserved for the wrapper lifetime.
在文件 Shape3D.cpp 第 120 行定义.
引用了 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 第 260 行定义.
引用了 eve::physics::Body3D::getType(), indices, isSensor(), eve::physics::Body3D::isValid(), eve::physics::ShapeGeometry3D::kind, eve::physics::ShapeGeometry3D::meshIdentifyEdges, eve::physics::ShapeGeometry3D::meshIndices, eve::physics::ShapeGeometry3D::meshUseMedianSplit, eve::physics::ShapeGeometry3D::meshVertices, eve::physics::ShapeGeometry3D::meshWeldTolerance, eve::physics::ShapeGeometry3D::meshWeldVertices , 以及 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 第 350 行定义.
引用了 eve::physics::SurfaceMaterial3D::friction, friction, getTriangleMeshMaterialCount(), eve::physics::ShapeGeometry3D::kind, material, restitution, rollingResistance, tangentX , 以及 tangentZ.
◆ setTriangleMeshMaterialIndices()
| void eve::physics::Shape3D::setTriangleMeshMaterialIndices | ( | const std::vector< int32_t > & | materialIndices | ) |
Atomically assigns one material-slot index per source mesh triangle.
在文件 Shape3D.cpp 第 298 行定义.
引用了 index, isSensor(), eve::physics::ShapeGeometry3D::kind, eve::physics::ShapeGeometry3D::meshIndices , 以及 eve::physics::ShapeGeometry3D::meshMaterialIndices.
◆ testPoint()
| bool eve::physics::Shape3D::testPoint | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
友元及相关函数文档
◆ Body3D
◆ box3d::Access
|
friend |
◆ box3d::WorldBackend
|
friend |
◆ jolt::WorldBackend
|
friend |
◆ PortableWorldSnapshotAccess
|
friend |
◆ World3D
◆ WorldSnapshotAccess
|
friend |
该类的文档由以下文件生成:
- src/modules/physics/Shape3D.h
- src/modules/physics/Shape3D.cpp