summaryrefslogtreecommitdiff
path: root/examples/SharedMemory/PhysicsDirect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/SharedMemory/PhysicsDirect.cpp')
-rw-r--r--examples/SharedMemory/PhysicsDirect.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/SharedMemory/PhysicsDirect.cpp b/examples/SharedMemory/PhysicsDirect.cpp
index a8aa72a60..f12057ae0 100644
--- a/examples/SharedMemory/PhysicsDirect.cpp
+++ b/examples/SharedMemory/PhysicsDirect.cpp
@@ -67,6 +67,7 @@ struct PhysicsDirectInternalData
btAlignedObjectArray<b3CollisionShapeData> m_cachedCollisionShapes;
b3MeshData m_cachedMeshData;
+ b3TetraMeshData m_cachedTetraMeshData;
btAlignedObjectArray<b3MeshVertex> m_cachedVertexPositions;
btAlignedObjectArray<b3VRControllerEvent> m_cachedVREvents;
@@ -99,6 +100,7 @@ struct PhysicsDirectInternalData
m_timeOutInSeconds(1e30)
{
memset(&m_cachedMeshData.m_numVertices, 0, sizeof(b3MeshData));
+ memset(&m_cachedTetraMeshData.m_numVertices, 0, sizeof(b3TetraMeshData));
memset(&m_command, 0, sizeof(m_command));
memset(&m_serverStatus, 0, sizeof(m_serverStatus));
memset(m_bulletStreamDataServerToClient, 0, sizeof(m_bulletStreamDataServerToClient));
@@ -1691,6 +1693,16 @@ void PhysicsDirect::getCachedMeshData(struct b3MeshData* meshData)
*meshData = m_data->m_cachedMeshData;
}
+void PhysicsDirect::getCachedTetraMeshData(struct b3TetraMeshData* meshData)
+{
+ m_data->m_cachedTetraMeshData.m_numVertices = m_data->m_cachedVertexPositions.size();
+
+ m_data->m_cachedTetraMeshData.m_vertices = m_data->m_cachedTetraMeshData.m_numVertices ? &m_data->m_cachedVertexPositions[0] : 0;
+
+ *meshData = m_data->m_cachedTetraMeshData;
+}
+
+
void PhysicsDirect::getCachedContactPointInformation(struct b3ContactInformation* contactPointData)
{
contactPointData->m_numContactPoints = m_data->m_cachedContactPoints.size();