Merge branch 'main' of http://188.166.59.26/brossferatu/coven
This commit is contained in:
@@ -207,18 +207,32 @@ update_transform_gizmo :: (ray: Ray, mouse_position: Vector2) -> bool {
|
||||
// Move the currently selected entity along the selected axis
|
||||
axis_vec : Vector3;
|
||||
|
||||
if engine.editor.transform_gizmo.selected_axis == {
|
||||
case .UP;
|
||||
axis_vec.y = 1;
|
||||
case .FORWARD;
|
||||
axis_vec.z = 1;
|
||||
case .RIGHT;
|
||||
axis_vec.x = 1;
|
||||
if engine.editor.transform_gizmo.space == {
|
||||
case .WORLD; {
|
||||
if engine.editor.transform_gizmo.selected_axis == {
|
||||
case .UP;
|
||||
axis_vec.y = 1;
|
||||
case .FORWARD;
|
||||
axis_vec.z = 1;
|
||||
case .RIGHT;
|
||||
axis_vec.x = 1;
|
||||
}
|
||||
}
|
||||
case .LOCAL; {
|
||||
if engine.editor.transform_gizmo.selected_axis == {
|
||||
case .UP;
|
||||
axis_vec = get_up(selected_entity.transform);
|
||||
case .FORWARD;
|
||||
axis_vec = get_forward(selected_entity.transform);
|
||||
case .RIGHT;
|
||||
axis_vec = get_right(selected_entity.transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
r1 : Ray;
|
||||
r1.origin = selected_entity.transform.position;
|
||||
r1.direction = rotate(axis_vec, engine.editor.transform_gizmo.transform.orientation);
|
||||
r1.direction = axis_vec;
|
||||
|
||||
r2 := normalized_screen_to_ray(*engine.editor.camera, mouse_position);
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ post_physx_sync :: (game_scene: *Scene) {
|
||||
|
||||
transform := PhysX.PxRigidActor_getGlobalPose(physx_actor.dynamic);
|
||||
|
||||
if physx_actor.sync_rotation_from_physx {
|
||||
if physx_actor.sync_rotation_from_physx || it.physics.type == .SPHERE {
|
||||
set_position_rotation(it, transform.p, transform.q);
|
||||
} else {
|
||||
set_position(it, transform.p);
|
||||
@@ -175,7 +175,7 @@ create_physx_actor :: (e: *Entity) {
|
||||
|
||||
if e.physics.lock & .ANGULAR_X {
|
||||
PhysX.PxRigidDynamic_setRigidDynamicLockFlag(dynamic, xx PhysX.PxRigidDynamicLockFlags.LockAngularX, true);
|
||||
}
|
||||
}
|
||||
if e.physics.lock & .ANGULAR_Y {
|
||||
PhysX.PxRigidDynamic_setRigidDynamicLockFlag(dynamic, xx PhysX.PxRigidDynamicLockFlags.LockAngularY, true);
|
||||
}
|
||||
@@ -207,6 +207,10 @@ create_physx_actor :: (e: *Entity) {
|
||||
|
||||
PhysX.PxRigidActor_attachShape(actor, shape);
|
||||
|
||||
if e.physics.dynamic {
|
||||
PhysX.PxRigidBodyExt_updateMassAndInertia(cast(*PhysX.PxRigidBody)actor, 1000.0, null, false);
|
||||
}
|
||||
|
||||
PhysX.PxScene_addActor(e.scene.physx_scene.scene, actor, null);
|
||||
|
||||
PhysX.PxShape_release(shape);
|
||||
|
||||
Reference in New Issue
Block a user