diff --git a/engine/engine.cpp b/engine/engine.cpp index 8581aa2..9adc14d 100644 --- a/engine/engine.cpp +++ b/engine/engine.cpp @@ -117,6 +117,7 @@ extern "C" void FunnyMain( int argc, char **argv ) SteamAPI_RunCallbacks(); #endif double fCurrent = Plat_GetTime(); + double fStart = Plat_GetTime(); double fDelta = fCurrent-fPrevious; fPrevious = fCurrent; @@ -124,15 +125,23 @@ extern "C" void FunnyMain( int argc, char **argv ) g_pHumanDeviceManager->Frame(); g_pServerGame->m_pBridge->Frame(fDelta); + fCurrent = Plat_GetTime(); + if (!stConstants.m_bIsDedicated) { + g_pWindowManager->Frame(fDelta); g_pClientGame->m_pBridge->Frame(fDelta); g_pRenderContext->Frame(fDelta); + + fCurrent = Plat_GetTime(); } Console()->Execute(); + + fCurrent = Plat_GetTime(); + }; }; diff --git a/external/GameNetworkingSockets b/external/GameNetworkingSockets index 725e273..517fff0 160000 --- a/external/GameNetworkingSockets +++ b/external/GameNetworkingSockets @@ -1 +1 @@ -Subproject commit 725e273c7442bac7a8bc903c0b210b1c15c34d92 +Subproject commit 517fff0cf6866ba163f4f016b0ef28f365c06c05 diff --git a/external/SDL b/external/SDL index 7c11a8c..1d08131 160000 --- a/external/SDL +++ b/external/SDL @@ -1 +1 @@ -Subproject commit 7c11a8cb9f66a2cac63f9a24ab2f49f6d4bf12a0 +Subproject commit 1d081314a89eb6bfd22bbc0224b604533ae6156b diff --git a/external/Vulkan-Headers b/external/Vulkan-Headers index 2e0a6e6..29184b9 160000 --- a/external/Vulkan-Headers +++ b/external/Vulkan-Headers @@ -1 +1 @@ -Subproject commit 2e0a6e699e35c9609bde2ca4abb0d380c0378639 +Subproject commit 29184b98984f6169a5e83e97557a77cff1e5b0ca diff --git a/external/Vulkan-Utility-Libraries b/external/Vulkan-Utility-Libraries index 4f4c0b6..c15a1ac 160000 --- a/external/Vulkan-Utility-Libraries +++ b/external/Vulkan-Utility-Libraries @@ -1 +1 @@ -Subproject commit 4f4c0b6c61223b703f1c753a404578d7d63932ad +Subproject commit c15a1ac31670cb2ce61c235f070fb40ec6e42612 diff --git a/external/VulkanMemoryAllocator b/external/VulkanMemoryAllocator index f0969e9..b3cbbb4 160000 --- a/external/VulkanMemoryAllocator +++ b/external/VulkanMemoryAllocator @@ -1 +1 @@ -Subproject commit f0969e908b01104f66bec2f203103de2012354c9 +Subproject commit b3cbbb43ea3a506dffe10759e205a41c27c35ae2 diff --git a/external/cglm b/external/cglm index a886d6e..83d5b2c 160000 --- a/external/cglm +++ b/external/cglm @@ -1 +1 @@ -Subproject commit a886d6e170292a1d534a7a2c0471be5953b16455 +Subproject commit 83d5b2c97378e61a4666825fd3a5548955c83add diff --git a/external/slang b/external/slang index 5d775e2..f267cb7 160000 --- a/external/slang +++ b/external/slang @@ -1 +1 @@ -Subproject commit 5d775e2829ceef5bd34ec89aa3eafa4968a74c8e +Subproject commit f267cb77a09b0f4cf083a9585bc1ddb3744c310a diff --git a/external/stb b/external/stb index 802cd45..e6cd956 160000 --- a/external/stb +++ b/external/stb @@ -1 +1 @@ -Subproject commit 802cd454f25469d3123e678af41364153c132c2a +Subproject commit e6cd9561ea6dae43d41633797745789d142b691e diff --git a/external/volk b/external/volk index d64d20b..e91ceff 160000 --- a/external/volk +++ b/external/volk @@ -1 +1 @@ -Subproject commit d64d20b4eaf2698296e085d9d9638c69af280e3e +Subproject commit e91ceff7db05f92ac8b498c9631235a6a73566e2 diff --git a/external/xtool b/external/xtool index 22655f3..f12a84e 160000 --- a/external/xtool +++ b/external/xtool @@ -1 +1 @@ -Subproject commit 22655f3e70b87bef9be736e9625984e21bf8c697 +Subproject commit f12a84e960fa9bced1249a8d233ab8eafca28f6f diff --git a/funnyassets/maps/test/test0.fpx b/funnyassets/maps/test/test0.fpx index 1e86f19..1d030b1 100644 --- a/funnyassets/maps/test/test0.fpx +++ b/funnyassets/maps/test/test0.fpx @@ -1,4 +1,4 @@ { - "Type": "Triangles", - "Mesh": "game/core/maps/test/test0.fpx" + "Type": "TriangleMesh", + "Mesh": "game/core/maps/test/test0.fmesh_c" } diff --git a/game/client/game.cpp b/game/client/game.cpp index b875e60..f3ee677 100644 --- a/game/client/game.cpp +++ b/game/client/game.cpp @@ -155,6 +155,8 @@ void CFunnyGameBridge::Frame( float fDelta ) float fTickRate = 1.0/60.0; m_fNetUpdateTimer += fDelta; + if (m_fNetUpdateTimer >= fTickRate) + m_fNetUpdateTimer = fTickRate; while (m_fNetUpdateTimer >= fTickRate) { m_fNetUpdateTimer-=fTickRate; diff --git a/game/server/assetmgr.cpp b/game/server/assetmgr.cpp index 8aa7a2c..94738a4 100644 --- a/game/server/assetmgr.cpp +++ b/game/server/assetmgr.cpp @@ -93,6 +93,7 @@ public: virtual void UnrefPhysics( HFunnyPhysics hPhysics ) override; CAssetArc m_models = {}; + CAssetArc m_meshes = {}; CAssetArc m_physics = {}; }; @@ -108,6 +109,7 @@ FunnyMaterial_t *CAssetManager::GetMaterialByIndex( uint32_t uIndex ) FunnyMesh_t *CAssetManager::GetMeshByIndex( uint32_t uIndex ) { + return m_meshes.GetObjectPtr(uIndex); } @@ -179,7 +181,30 @@ HFunnyMesh CAssetManager::LoadMesh( const char *szName ) { - return 0; + + bool bHasBeenCreated = false; + HFunnyMesh hAsset = m_meshes.GetOrCreateObject(szName, &bHasBeenCreated); + if (!bHasBeenCreated) + return hAsset; + FunnyMesh_t *pMesh = m_meshes.GetObjectPtr(hAsset); + + IFileHandle *hMesh = filesystem->Open(szName, FILEMODE_READ); + if ( hMesh == NULL ) + { + V_printf("Failed to load %s\n", szName); + m_meshes.UnrefObject(hAsset); + return 0; + } + + + pMesh->m_nPositionCount = filesystem->Size(hMesh)/4; + pMesh->m_pfPositions = new float[pMesh->m_nPositionCount]; + filesystem->Read( hMesh, pMesh->m_pfPositions, filesystem->Size(hMesh)); + pMesh->m_nIndiciesCount = 0; + pMesh->m_puIndicies = 0; + + + return hAsset; } void CAssetManager::UnrefMesh( uint32_t uIndex ) @@ -231,8 +256,25 @@ HFunnyPhysics CAssetManager::LoadPhysics( const char *szName ) { pPhysics->m_hShape = g_pPhysics->CreateBall({1.0}); } - if (szType == "Triangles") + if (szType == "TriangleMesh") { + V_printf("hi\n"); + IJSONValue *pMeshValue = pMainObject->GetValue("Mesh"); + V_printf("hi\n"); + if (!pMeshValue) + { + + V_printf("\"Mesh\" must be specified\n"); + m_physics.UnrefObject(hPhysics); + return 0; + } + CUtlString szMesh = pMeshValue->GetStringValue(); + V_printf("%s\n", szMesh.GetString()); + HFunnyMesh hMesh = LoadMesh(szMesh); + FunnyMesh_t *pMesh = GetMeshByIndex(hMesh); + pPhysics->m_hShape = g_pPhysics->CreateTriangleMesh({pMesh->m_pfPositions, pMesh->m_nPositionCount}); + V_printf("%p\n", pPhysics->m_hShape); + pPhysics->m_hMesh = hMesh; } return hPhysics; diff --git a/game/server/assetmgr.h b/game/server/assetmgr.h index 020a9d3..cff5ac4 100644 --- a/game/server/assetmgr.h +++ b/game/server/assetmgr.h @@ -16,11 +16,20 @@ struct FunnyMaterial_t struct FunnyMesh_t { + float *m_pfPositions; + uint32_t m_nPositionCount; + uint32_t *m_puIndicies; + uint32_t m_nIndiciesCount; }; struct FunnyPhysics_t { HShape m_hShape; + + union + { + HFunnyMesh m_hMesh; + }; }; struct FunnyModel_t diff --git a/game/server/game.cpp b/game/server/game.cpp index 103c568..b633049 100644 --- a/game/server/game.cpp +++ b/game/server/game.cpp @@ -205,6 +205,8 @@ void CFunnyGameBridge::Frame( float fDelta ) float fTickRate = 1.0/60.0; m_fNetUpdateTimer += fDelta; + if (m_fNetUpdateTimer >= 0.3) + m_fNetUpdateTimer = 0.3; while (m_fNetUpdateTimer >= fTickRate) { m_fNetUpdateTimer-=fTickRate; diff --git a/game/server/milmoba/player.cpp b/game/server/milmoba/player.cpp index 222b1fd..da2fb21 100644 --- a/game/server/milmoba/player.cpp +++ b/game/server/milmoba/player.cpp @@ -22,6 +22,7 @@ void CMOBAPlayer::Think( float fDelta ) vPosition.x += m_vMovementVector.x*fDelta*5; vPosition.z += m_vMovementVector.z*fDelta*5; SetAbsOrigin(vPosition); + V_printf("player: %f %f %f\n", vPosition.x, vPosition.y, vPosition.z); }; LINK_ENTITY_TO_CLASS(player, CMOBAPlayer) diff --git a/game/server/physicsprop.cpp b/game/server/physicsprop.cpp index b0a2a3f..e59d437 100644 --- a/game/server/physicsprop.cpp +++ b/game/server/physicsprop.cpp @@ -11,8 +11,6 @@ void CPhysicsProp::Spawn() { CBaseEntity::Spawn(); SetThink(Think); - - V_printf("hi\n"); } void CPhysicsProp::Think( float fDelta ) @@ -60,6 +58,8 @@ void CPhysicsProp::OnModelChanged( const char *szName ) m_pPhysics = g_pAssetManager->GetPhysicsByIndex(m_pModel->m_hPhysics); m_hCollider = g_pPhysics->CreateCollider(m_pPhysics->m_hShape); m_pBody = g_pPhysicsWorld->CreateRigidBody(m_hCollider, k_EPhysics_Dynamic); + m_pBody->SetPosition({0,0,0}); + m_pBody->SetRotation({0,0,0}); } void CPhysicsProp::EnableMovement() @@ -71,5 +71,8 @@ void CPhysicsProp::DisableMovement() { } +BEGIN_DATADESC(CPhysicsProp) + DEFINE_KEYFIELD(m_ePhysicsType, FIELD_INTEGER, "physics_type") +END_DATADESC() LINK_ENTITY_TO_CLASS(prop_physics, CPhysicsProp) diff --git a/game/server/physicsprop.h b/game/server/physicsprop.h index b5cc194..8f98d19 100644 --- a/game/server/physicsprop.h +++ b/game/server/physicsprop.h @@ -8,7 +8,8 @@ class CPhysicsProp: public CBaseModelEntity friend CBaseEntity; friend CBaseModelEntity; public: - DECLARE_CLASS(CPhysicsProp, CBaseModelEntity); + DECLARE_CLASS(CPhysicsProp, CBaseModelEntity) + DECLARE_DATADESC() virtual void Spawn() override; virtual void Precache() override; @@ -20,14 +21,18 @@ public: virtual void EnableMovement(); virtual void DisableMovement(); + virtual void SetPhysics( EPhysicsBodyType eType ); + void Think( float fDelta ); private: EPhysicsBodyType m_ePhysicsType; + EPhysicsBodyType m_eCurrentPhysicsType; HFunnyModel m_hModel = 0; FunnyModel_t *m_pModel = NULL; FunnyPhysics_t *m_pPhysics = NULL; HCollider m_hCollider = 0; IPhysicsBody *m_pBody = NULL; + }; #endif diff --git a/public/iphysics.h b/public/iphysics.h index f3228bd..3bb1883 100644 --- a/public/iphysics.h +++ b/public/iphysics.h @@ -17,7 +17,7 @@ struct CuboidShape_t float m_fExtentZ; }; -struct TrianglesShape_t +struct TriangleMeshShape_t { float *m_pfPositions; uint32_t m_nPositionCount; @@ -45,6 +45,7 @@ public: virtual void SetRotation( Quat vRotation ) = 0; virtual Vector GetPosition() = 0; virtual Quat GetRotation() = 0; + virtual void SetType( EPhysicsBodyType eType ) = 0; virtual void SetGravityScale( float fScale ) = 0; }; @@ -66,7 +67,7 @@ abstract_class IPhysics public: virtual HShape CreateBall( BallShape_t ball ) = 0; virtual HShape CreateCube( CuboidShape_t ball ) = 0; - virtual HShape CreateTriangles( TrianglesShape_t shape ) = 0; + virtual HShape CreateTriangleMesh( TriangleMeshShape_t shape ) = 0; virtual void DestroyShape( HShape hShape ) = 0; virtual HCollider CreateCollider( HShape hShape ) = 0; diff --git a/rapier/build.cpp b/rapier/build.cpp index 62769a7..7951095 100644 --- a/rapier/build.cpp +++ b/rapier/build.cpp @@ -17,11 +17,10 @@ DECLARE_BUILD_STAGE(rapier) CUtlString szTarget = target.GetTriplet(); if (CommandLine()->CheckParam("-norust")) return 0; - rapier_lib = CUtlString("target/%s/release/librapier_rtt.a",szTarget.GetString()); + rapier_lib = CUtlString("target/%s/debug/librapier_rtt.a",szTarget.GetString()); V_printf("%s\n",rapier_lib.GetString()); CUtlVector cargo_args = { "build", - "--release", "--target", szTarget }; diff --git a/rapier/physics.cpp b/rapier/physics.cpp index 611a18a..0941d9b 100644 --- a/rapier/physics.cpp +++ b/rapier/physics.cpp @@ -4,6 +4,7 @@ // //===========================================================================// +#include "tier0/lib.h" #include "physics.h" #define PHYSICS_OBJECT_DEFINED #define TRIG_H @@ -95,9 +96,9 @@ public: return CRapierPhysics_CreateCube(m_pRustHandle, ball); } - virtual HShape CreateTriangles( TrianglesShape_t shape ) override + virtual HShape CreateTriangleMesh( TriangleMeshShape_t shape ) override { - return CRapierPhysics_CreateCube(m_pRustHandle, shape); + return CRapierPhysics_CreateTriangleMesh(m_pRustHandle, shape); } virtual void DestroyShape( HShape hShape ) override diff --git a/rapier/physics.h b/rapier/physics.h index 59ac7bf..580c8e3 100644 --- a/rapier/physics.h +++ b/rapier/physics.h @@ -43,6 +43,13 @@ typedef struct CuboidShape_t { float m_fExtentZ; } CuboidShape_t; +typedef struct TriangleMeshShape_t { + const float *m_pfPositions; + uint32_t m_nPositionCount; + const float *m_puIndicies; + uint32_t m_nIndiciesCount; +} TriangleMeshShape_t; + #ifdef __cplusplus extern "C" { #endif // __cplusplus @@ -62,6 +69,8 @@ void CRapierPhysicsBody_SetRotation(struct RapierPhysicsBody_t *this_, float fZ, float fW); +void CRapierPhysicsBody_SetType(struct RapierPhysicsBody_t *this_, enum EPhysicsBodyType eType); + struct RapierPhysicsBody_t *CRapierPhysicsWorld_CreateRigidBody(struct RapierWorld_t *this_, struct RapierCollider_t *pCollider, enum EPhysicsBodyType eType); @@ -77,6 +86,9 @@ struct RapierCollider_t *CRapierPhysics_CreateCollider(struct RapierPhysics_t *t struct RapierShape_t *CRapierPhysics_CreateCube(struct RapierPhysics_t *this_, struct CuboidShape_t cuboid); +struct RapierShape_t *CRapierPhysics_CreateTriangleMesh(struct RapierPhysics_t *this_, + struct TriangleMeshShape_t triangle); + struct RapierWorld_t *CRapierPhysics_CreateWorld(struct RapierPhysics_t *this_); struct RapierPhysics_t *CRapierPhysics_New(void); diff --git a/rapier/physics.rs b/rapier/physics.rs index 4201df6..6f05ae5 100644 --- a/rapier/physics.rs +++ b/rapier/physics.rs @@ -13,7 +13,7 @@ macro_rules! V_malloc { }; } -use std::{default, ptr::{self, null}, sync::Arc}; +use std::{default, ops::Index, ptr::{self, null, null_mut}, slice::from_raw_parts, sync::Arc}; use parry3d::{glamx::vec3, shape::{Shape, ShapeType, SharedShape}}; use rapier3d::{geometry::Ball, na::{UnitQuaternion, Vector4}}; @@ -37,38 +37,21 @@ pub struct CuboidShape_t m_fExtentZ: f32, } -#[derive(Clone)] +#[repr(C)] +#[derive(Clone, Copy)] #[derive(Debug)] -pub enum RapierShapeType { - Ball(Ball), - Cuboid(Cuboid), - Capsule(Capsule), - Segment(Segment), - Triangle(Triangle), - Voxels(Voxels), - TriMesh(TriMesh), - Polyline(Polyline), - HalfSpace(HalfSpace), - HeightField(HeightField), - Compound(Compound), - ConvexPolyhedron(ConvexPolyhedron), - Cylinder(Cylinder), - Cone(Cone), - RoundCuboid(RoundCuboid), - RoundTriangle(RoundTriangle), - RoundCylinder(RoundCylinder), - RoundCone(RoundCone), - RoundConvexPolyhedron(RoundConvexPolyhedron), - #[allow(dead_code)] - Custom, +pub struct TriangleMeshShape_t +{ + m_pfPositions: *const f32, + m_nPositionCount: u32, + m_puIndicies: *const f32, + m_nIndiciesCount: u32, } - #[derive(Clone)] #[derive(Debug)] pub struct RapierShape_t { - m_shape: RapierShapeType, m_sharedShape: SharedShape, } @@ -122,13 +105,6 @@ pub struct RapierPhysics_t } -struct TrianglesShape_t -{ - m_pfPositions: *const f32, - m_nPositionCount: const u32, - m_puIndicies, - m_nIndiciesCount, -}; #[no_mangle] pub unsafe extern "C" fn CRapierPhysicsBody_SetPosition( this: *mut RapierPhysicsBody_t, fX: f32, fY: f32, fZ: f32 ) @@ -157,7 +133,7 @@ pub struct Vector { pub unsafe extern "C" fn CRapierPhysicsBody_GetPosition( this: *mut RapierPhysicsBody_t ) -> Vector { let world: &mut RapierWorld_t = &mut *(*this).m_pWorld; - let position = world.m_rigidBodies[(*this).m_hRigidBodyHandle] + let mut position = world.m_rigidBodies[(*this).m_hRigidBodyHandle] .translation().to_array(); return Vector { x: position[0], y: position[1], z: position[2]} } @@ -179,6 +155,22 @@ pub unsafe extern "C" fn CRapierPhysicsBody_GetRotation( this: *mut RapierPhysic Quat{ x: rotationVector[0], y: rotationVector[1], z: rotationVector[2], w: rotationVector[3]} } +#[no_mangle] +pub unsafe extern "C" fn CRapierPhysicsBody_SetType( this: *mut RapierPhysicsBody_t, eType: EPhysicsBodyType ) +{ + let world: &mut RapierWorld_t = &mut *(*this).m_pWorld; + let eRapierBodyType: RigidBodyType; + match eType + { + EPhysicsBodyType::k_EPhysics_Static => eRapierBodyType = RigidBodyType::Fixed, + EPhysicsBodyType::k_EPhysics_Dynamic => eRapierBodyType = RigidBodyType::Dynamic, + EPhysicsBodyType::k_EPhysics_KinematicPositionBased => eRapierBodyType = RigidBodyType::KinematicPositionBased, + EPhysicsBodyType::k_EPhysics_KinematicVelocityBased => eRapierBodyType = RigidBodyType::KinematicVelocityBased, + } + world.m_rigidBodies[(*this).m_hRigidBodyHandle] + .set_body_type(eRapierBodyType, true); +} + #[no_mangle] pub unsafe extern "C" fn CRapierPhysicsWorld_Frame( this: *mut RapierWorld_t, fDelta: f32 ) { @@ -245,14 +237,8 @@ pub unsafe extern "C" fn CRapierPhysics_New() -> *mut RapierPhysics_t pub unsafe extern "C" fn CRapierPhysics_CreateBall( this: *mut RapierPhysics_t, ball: BallShape_t ) -> *mut RapierShape_t { let pShapeMemory: *mut RapierShape_t = V_malloc!(RapierShape_t, 1); - std::ptr::write(&mut (*pShapeMemory).m_shape, RapierShapeType::Ball(Ball::new(ball.m_fRadius))); - match ((*pShapeMemory).m_shape) - { - RapierShapeType::Ball(b) => { - std::ptr::write(&mut (*pShapeMemory).m_sharedShape, SharedShape::new(b)); - } - _ => {} - } + std::ptr::write(&mut (*pShapeMemory).m_sharedShape, SharedShape::new(Ball::new(ball.m_fRadius))); + pShapeMemory } @@ -260,15 +246,52 @@ pub unsafe extern "C" fn CRapierPhysics_CreateBall( this: *mut RapierPhysics_t, pub unsafe extern "C" fn CRapierPhysics_CreateCube( this: *mut RapierPhysics_t, cuboid: CuboidShape_t ) -> *mut RapierShape_t { let pShapeMemory: *mut RapierShape_t = V_malloc!(RapierShape_t, 1); - std::ptr::write(&mut (*pShapeMemory).m_shape, RapierShapeType::Cuboid( + std::ptr::write(&mut (*pShapeMemory).m_sharedShape, SharedShape::new( Cuboid::new(vec3(cuboid.m_fExtentX, cuboid.m_fExtentY, cuboid.m_fExtentZ))) ); - match ((*pShapeMemory).m_shape) + pShapeMemory +} + +#[no_mangle] +pub unsafe extern "C" fn CRapierPhysics_CreateTriangleMesh( this: *mut RapierPhysics_t, triangle: TriangleMeshShape_t ) -> *mut RapierShape_t +{ + let pShapeMemory: *mut RapierShape_t = V_malloc!(RapierShape_t, 1); + let positions = Vec::from_raw_parts(triangle.m_pfPositions as *mut Vec3, triangle.m_nPositionCount as usize, triangle.m_nPositionCount as usize); + let mut indices: Vec<[u32; 3]>; + + if ( triangle.m_nIndiciesCount == 0 ) { - RapierShapeType::Cuboid(b) => { - std::ptr::write(&mut (*pShapeMemory).m_sharedShape, SharedShape::new(b)); + if ( triangle.m_nPositionCount % 3 != 0 ) + { + return null_mut(); } - _ => {} + indices = vec![[0,0,0]; (triangle.m_nPositionCount/3) as usize]; + for i in 0..indices.len()/3 + { + let u = i as u32; + indices[i][0] = u*3; + indices[i][1] = u*3+1; + indices[i][2] = u*3+2; + + } + } + else + { + if ( triangle.m_nIndiciesCount % 3 != 0 ) + { + return null_mut(); + } + indices = Vec::from_raw_parts(triangle.m_puIndicies as *mut [u32; 3], triangle.m_nIndiciesCount as usize, triangle.m_nIndiciesCount as usize); + } + + let mesh = TriMesh::new(positions, indices); + match mesh + { + Ok(m) => + { + std::ptr::write(&mut (*pShapeMemory).m_sharedShape, SharedShape::new(m)); + } + default => {} } pShapeMemory } @@ -276,13 +299,9 @@ pub unsafe extern "C" fn CRapierPhysics_CreateCube( this: *mut RapierPhysics_t, #[no_mangle] pub unsafe extern "C" fn CRapierPhysics_CreateCollider( this: *mut RapierPhysics_t, pShape: *mut RapierShape_t ) -> *mut RapierCollider_t { - println!("this {:?}", pShape); let shape: &SharedShape = &(*pShape).m_sharedShape; - println!("this {:?}", pShape); let pCollider = V_malloc!(RapierCollider_t, 1); - println!("this {:?}", pShape); std::ptr::write(&mut (*pCollider).m_collider, ColliderBuilder::new(shape.clone()).build()); - println!("this {:?}", pShape); pCollider }