Skip to content

Commit

Permalink
RigidBody.h:
Browse files Browse the repository at this point in the history
* Added component-wise getters and setters for position and velocity.
  • Loading branch information
razterizer committed Nov 19, 2024
1 parent 0c43fb0 commit 102db79
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dynamics/RigidBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,16 @@ namespace dynamics

Vec2 get_curr_cm() const { return curr_cm; }

float get_curr_cm_r() const { return curr_cm.r; }

float get_curr_cm_c() const { return curr_cm.c; }

void set_curr_cm(const Vec2& cm) { curr_cm = cm; }

void set_curr_cm_r(float row_loc) { curr_cm.r = row_loc; }

void set_curr_cm_c(float col_loc) { curr_cm.c = col_loc; }

void reset_curr_cm() { curr_cm = orig_pos + curr_cm_local; }

Vec2 get_curr_centroid() const { return curr_centroid; }
Expand Down Expand Up @@ -258,8 +266,16 @@ namespace dynamics

Vec2 get_curr_lin_vel() const { return curr_vel; }

float get_curr_lin_vel_r() const { return curr_vel.r; }

float get_curr_lin_vel_c() const { return curr_vel.c; }

void set_curr_lin_vel(const Vec2& vel) { curr_vel = vel; }

void set_curr_lin_speed_r(float row_speed) { curr_vel.r = row_speed; }

void set_curr_lin_speed_c(float col_speed) { curr_vel.c = col_speed; }

float get_inv_mass() const { return inv_mass; }

float get_inv_Iz() const { return inv_Iz; }
Expand Down

0 comments on commit 102db79

Please sign in to comment.