Cramming PhysX in there
More PhysX work More PhysX work
This commit is contained in:
@@ -81,6 +81,9 @@ Entity :: struct {
|
||||
// Physics
|
||||
body : Physics_Body;
|
||||
collider : Collider;
|
||||
physx_static: *PhysX.PxRigidStatic;
|
||||
physx_dynamic: *PhysX.PxRigidDynamic;
|
||||
|
||||
// End physics
|
||||
|
||||
#if NETWORKING {
|
||||
|
||||
@@ -22,6 +22,8 @@ Scene :: struct {
|
||||
|
||||
mode: Engine_Mode;
|
||||
|
||||
physx_scene: *PhysX.PxScene;
|
||||
|
||||
using custom_fields: _Custom_Scene_Fields;
|
||||
}
|
||||
|
||||
@@ -142,6 +144,8 @@ unload_scene :: (scene: *Scene) {
|
||||
destroy_entity(e);
|
||||
}
|
||||
|
||||
PhysX.PxScene_release(scene.physx_scene);
|
||||
|
||||
free(scene.name);
|
||||
fini(*scene.pool);
|
||||
free(scene);
|
||||
@@ -191,6 +195,8 @@ create_scene :: (name: string = "", max_entities: s64 = 256) -> *Scene {
|
||||
|
||||
array_reserve(*scene.entities, max_entities);
|
||||
|
||||
scene.physx_scene = create_physx_scene();
|
||||
|
||||
scene.directional_light.color_and_intensity = .{1,1,1,2};
|
||||
scene.directional_light.direction = to_v4(normalize(Vector3.{0.4, -0.7, 0.4}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user