20#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
44 btQuantizedBvhDoubleData* bvhData = arrays->
m_bvhsDouble[i];
45 bvh->deSerializeDouble(*bvhData);
51 btQuantizedBvhFloatData* bvhData = arrays->
m_bvhsFloat[i];
52 bvh->deSerializeFloat(*bvhData);
66 if (shape && shapeData->
m_name)
78 if (shapePtr && *shapePtr)
89#ifdef USE_INTERNAL_EDGE_UTILITY
93 if (trimesh->getTriangleInfoMap())
95 body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
103 printf(
"error: no shape found\n");
110 if (shapePtr && *shapePtr)
119#ifdef USE_INTERNAL_EDGE_UTILITY
123 if (trimesh->getTriangleInfoMap())
125 body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
133 printf(
"error: no shape found\n");
255 shape->setLocalScaling(localScaling);
272#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
287 shape = gimpactShape;
291 printf(
"unsupported gimpact sub type\n");
321 printf(
"error: wrong up axis for btCapsuleShape\n");
327 cap->deSerializeFloat(capData);
363 btVector3 halfExtents = implicitShapeDimensions + margin;
383 printf(
"unknown Cylinder up axis\n");
392 btVector3 halfExtents = implicitShapeDimensions;
412 printf(
"unknown Cone up axis\n");
426 tmpPos.
resize(numSpheres);
428 for (i = 0; i < numSpheres; i++)
445 tmpPoints.
resize(numPoints);
447 for (i = 0; i < numPoints; i++)
449#ifdef BT_USE_DOUBLE_PRECISION
462 for (i = 0; i < numPoints; i++)
464 hullShape->addPoint(tmpPoints[i]);
483 shape->setLocalScaling(localScaling);
492 if (!meshInterface->getNumSubParts())
499 meshInterface->setScaling(scaling);
506 if (bvhPtr && *bvhPtr)
519 if (bvhPtr && *bvhPtr)
533 shape = trimeshShape;
539 trimeshShape->setTriangleInfoMap(map);
541#ifdef USE_INTERNAL_EDGE_UTILITY
568 compoundShape->addChildShape(localTransform, childShape);
573 printf(
"error: couldn't create childShape for compoundShape\n");
577 shape = compoundShape;
600 int l = (
int)strlen(name);
601 char* newName =
new char[
l + 1];
602 memcpy(newName, name,
l);
623 meshPart.m_triangleIndexStride = 3 *
sizeof(
int);
624 int* indexArray = (
int*)
btAlignedAlloc(
sizeof(
int) * 3 * meshPart.m_numTriangles, 16);
626 for (
int j = 0; j < 3 * meshPart.m_numTriangles; j++)
630 meshPart.m_triangleIndexBase = (
const unsigned char*)indexArray;
637 meshPart.m_triangleIndexStride =
sizeof(
short int) * 3;
639 short int* indexArray = (
short int*)
btAlignedAlloc(
sizeof(
short int) * 3 * meshPart.m_numTriangles, 16);
642 for (
int j = 0; j < meshPart.m_numTriangles; j++)
649 meshPart.m_triangleIndexBase = (
const unsigned char*)indexArray;
654 meshPart.m_triangleIndexStride = 3 *
sizeof(
short int);
655 short int* indexArray = (
short int*)
btAlignedAlloc(
sizeof(
short int) * 3 * meshPart.m_numTriangles, 16);
657 for (
int j = 0; j < 3 * meshPart.m_numTriangles; j++)
662 meshPart.m_triangleIndexBase = (
const unsigned char*)indexArray;
668 meshPart.m_triangleIndexStride =
sizeof(
unsigned char) * 3;
670 unsigned char* indexArray = (
unsigned char*)
btAlignedAlloc(
sizeof(
unsigned char) * 3 * meshPart.m_numTriangles, 16);
673 for (
int j = 0; j < meshPart.m_numTriangles; j++)
680 meshPart.m_triangleIndexBase = (
const unsigned char*)indexArray;
691 for (
int j = 0; j < meshPart.m_numVertices; j++)
698 meshPart.m_vertexBase = (
const unsigned char*)vertices;
708 for (
int j = 0; j < meshPart.m_numVertices; j++)
715 meshPart.m_vertexBase = (
const unsigned char*)vertices;
718 if (meshPart.m_triangleIndexBase && meshPart.m_vertexBase)
720 meshInterface->addIndexedMesh(meshPart, meshPart.m_indexType);
724 return meshInterface;
763 bool uninitialized3indices8Workaround =
false;
767 uninitialized3indices8Workaround =
true;
776 uninitialized3indices8Workaround =
true;
785 uninitialized3indices8Workaround =
true;
792 if (!uninitialized3indices8Workaround && curPart->
m_3indices8)
806#ifdef USE_INTERNAL_EDGE_UTILITY
848 if (bodyPtr && *bodyPtr)
858 colObj->setWorldTransform(startTransform);
859 colObj->setCollisionShape(shape);
981 bvhTriMesh->setOptimizedBvh(bvh);
994#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
1045 if (shapePtr && *shapePtr)
1055 if (namePtr && *namePtr)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between world
ATTR_WARN_UNUSED_RESULT const BMLoop * l
#define btAlignedFree(ptr)
#define btAlignedAlloc(size, alignment)
btBoxShape(const btVector3 &boxHalfExtents)
@ COMPOUND_SHAPE_PROXYTYPE
@ GIMPACT_SHAPE_PROXYTYPE
Used for GIMPACT Trimesh integration.
@ SOFTBODY_SHAPE_PROXYTYPE
@ SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE
@ TRIANGLE_MESH_SHAPE_PROXYTYPE
@ MULTI_SPHERE_SHAPE_PROXYTYPE
@ CYLINDER_SHAPE_PROXYTYPE
@ CAPSULE_SHAPE_PROXYTYPE
@ CONVEX_HULL_SHAPE_PROXYTYPE
btBvhTriangleMeshShape(btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, bool buildBvh=true)
btCapsuleShape()
only used for btCapsuleShapeZ and btCapsuleShapeX subclasses.
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
btCompoundShape(bool enableDynamicAabbTree=true, const int initialChildCapacity=0)
btConeShape(btScalar radius, btScalar height)
btConvexHullShape(const btScalar *points=0, int numPoints=0, int stride=sizeof(btVector3))
btCylinderShape(const btVector3 &halfExtents)
@ CONST_GIMPACT_TRIMESH_SHAPE
void btAdjustInternalEdgeContacts(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, const btCollisionObjectWrapper *colObj1Wrap, int partId0, int index0, int normalAdjustFlags)
Changes a btManifoldPoint collision normal to the normal from the mesh.
ContactAddedCallback gContactAddedCallback
This is to allow MaterialCombiner/Custom Friction/Restitution values.
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
btMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape *childShape, const btVector3 &localScaling)
btSphereShape(btScalar radius)
btStaticPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
btTriangleIndexVertexArray()
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE void resize(int newsize, const T &fillData=T())
SIMD_FORCE_INLINE void push_back(const T &_Val)
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
virtual void deleteAllData()
virtual ~btCollisionWorldImporter()
virtual btStridingMeshInterfaceData * createStridingMeshInterfaceData(btStridingMeshInterfaceData *interfaceData)
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
btAlignedObjectArray< btTriangleIndexVertexArray * > m_allocatedTriangleIndexArrays
virtual btCollisionShape * createCylinderShapeX(btScalar radius, btScalar height)
bool convertAllObjects(btBulletSerializedArrays *arrays)
int getNumTriangleInfoMaps() const
btCollisionShape * getCollisionShapeByName(const char *name)
virtual btCollisionShape * createPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
shapes
char * duplicateName(const char *name)
virtual class btTriangleIndexVertexArray * createTriangleMeshContainer()
btCollisionShape * convertCollisionShape(btCollisionShapeData *shapeData)
virtual btCollisionShape * createConeShapeZ(btScalar radius, btScalar height)
btTriangleInfoMap * getTriangleInfoMapByIndex(int index) const
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
btCollisionWorld * m_collisionWorld
virtual class btCompoundShape * createCompoundShape()
virtual class btMultiSphereShape * createMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
virtual btCollisionShape * createConeShapeY(btScalar radius, btScalar height)
virtual btCollisionShape * createSphereShape(btScalar radius)
btCollisionShape * getCollisionShapeByIndex(int index)
virtual btCollisionShape * createBoxShape(const btVector3 &halfExtents)
btAlignedObjectArray< btVector3DoubleData * > m_doubleVertexArrays
virtual btCollisionShape * createCylinderShapeZ(btScalar radius, btScalar height)
virtual class btConvexHullShape * createConvexHullShape()
btAlignedObjectArray< int * > m_indexArrays
const char * getNameForPointer(const void *ptr) const
virtual btTriangleInfoMap * createTriangleInfoMap()
int getNumCollisionShapes() const
virtual btCollisionShape * createConeShapeX(btScalar radius, btScalar height)
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
btCollisionObject * getCollisionObjectByName(const char *name)
btAlignedObjectArray< char * > m_allocatedNames
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
btAlignedObjectArray< short int * > m_shortIndexArrays
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
btOptimizedBvh * getBvhByIndex(int index) const
btHashMap< btHashString, btCollisionObject * > m_nameColObjMap
btCollisionObject * getRigidBodyByIndex(int index) const
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
btHashMap< btHashPtr, const char * > m_objectNameMap
int getNumRigidBodies() const
btAlignedObjectArray< btCollisionObject * > m_allocatedCollisionObjects
virtual btCollisionShape * createConvexTriangleMeshShape(btStridingMeshInterface *trimesh)
virtual class btScaledBvhTriangleMeshShape * createScaledTrangleMeshShape(btBvhTriangleMeshShape *meshShape, const btVector3 &localScalingbtBvhTriangleMeshShape)
virtual btCollisionShape * createCylinderShapeY(btScalar radius, btScalar height)
virtual btCollisionShape * createCapsuleShapeY(btScalar radius, btScalar height)
virtual btCollisionShape * createCapsuleShapeZ(btScalar radius, btScalar height)
btAlignedObjectArray< btVector3FloatData * > m_floatVertexArrays
btAlignedObjectArray< btTriangleInfoMap * > m_allocatedTriangleInfoMaps
virtual btCollisionObject * createCollisionObject(const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
those virtuals are called by load and can be overridden by the user
virtual btTriangleIndexVertexArray * createMeshInterface(btStridingMeshInterfaceData &meshData)
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
btCollisionWorldImporter(btCollisionWorld *world)
btAlignedObjectArray< unsigned char * > m_charIndexArrays
btAlignedObjectArray< btCollisionShape * > m_allocatedCollisionShapes
virtual btCollisionShape * createCapsuleShapeX(btScalar radius, btScalar height)
CollisionWorld is interface and container for the collision detection.
btConeShape implements a Cone shape, around the X axis
btConeShapeZ implements a Cone shape, around the Z axis
This class manages a mesh supplied by the btStridingMeshInterface interface.
virtual void setMargin(btScalar margin)
virtual void setLocalScaling(const btVector3 &scaling)
SIMD_FORCE_INLINE void updateBound()
performs refit operation
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
btAlignedObjectArray< struct btQuantizedBvhDoubleData * > m_bvhsDouble
btAlignedObjectArray< struct btCollisionObjectFloatData * > m_collisionObjectDataFloat
btAlignedObjectArray< struct btCollisionObjectDoubleData * > m_collisionObjectDataDouble
btAlignedObjectArray< struct btCollisionShapeData * > m_colShapeData
btAlignedObjectArray< struct btQuantizedBvhFloatData * > m_bvhsFloat
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
unsigned char m_values[3]
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTransformDoubleData m_worldTransform
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTransformFloatData m_worldTransform
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTransformFloatData m_transform
btCollisionShapeData * m_childShape
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btCompoundShapeChildData * m_childShapePtr
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3DoubleData * m_unscaledPointsDoublePtr
btVector3FloatData * m_unscaledPointsFloatPtr
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3FloatData m_implicitShapeDimensions
btVector3FloatData m_localScaling
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btStridingMeshInterfaceData m_meshInterface
btVector3FloatData m_localScaling
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btShortIntIndexData * m_indices16
btCharIndexTripletData * m_3indices8
btVector3FloatData * m_vertices3f
btShortIntIndexTripletData * m_3indices16
btIntIndexData * m_indices32
btVector3DoubleData * m_vertices3d
int m_localPositionArraySize
btPositionAndRadius * m_localPositionArrayPtr
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTriangleMeshShapeData m_trimeshShapeData
btVector3FloatData m_localScaling
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3FloatData m_localScaling
btVector3FloatData m_planeNormal
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btMeshPartData * m_meshPartsPtr
btVector3FloatData m_scaling
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
void deSerialize(struct btTriangleInfoMapData &data)
fills the dataBuffer and returns the struct name (and 0 on failure)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btStridingMeshInterfaceData m_meshInterface
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
btQuantizedBvhFloatData * m_quantizedFloatBvh
btTriangleInfoMapData * m_triangleInfoMap