Skip to content

Commit

Permalink
Add Shape Rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenph69 committed Aug 14, 2023
1 parent 2241e55 commit 03d0f3c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions gdextension/src/grass/mgrass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,13 +590,16 @@ void MGrass::update_physics(Vector3 cam_pos){
wpos += shape_offset;
// Godot physics not work properly with collission transformation
// So for now we ignore transformation
//Vector3 x_axis(ptr[0],ptr[4],ptr[8]);
//Vector3 y_axis(ptr[1],ptr[5],ptr[9]);
//Vector3 z_axis(ptr[2],ptr[6],ptr[10]);
Vector3 x_axis(ptr[0],ptr[4],ptr[8]);
Vector3 y_axis(ptr[1],ptr[5],ptr[9]);
Vector3 z_axis(ptr[2],ptr[6],ptr[10]);
///
Vector3 x_axis(1,0,0);
Vector3 y_axis(0,1,0);
Vector3 z_axis(0,0,1);
//Vector3 x_axis(1,0,0);
//Vector3 y_axis(0,1,0);
//Vector3 z_axis(0,0,1);
x_axis.normalize();
y_axis.normalize();
z_axis.normalize();
Basis b(x_axis,y_axis,z_axis);
Transform3D t(b,wpos);
//UtilityFunctions::print(t);
Expand Down

0 comments on commit 03d0f3c

Please sign in to comment.