diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-27 23:21:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-27 23:21:36 +0400 |
commit | 124c55fcc3e377a2a6340d7dd64af1e1659497bd (patch) | |
tree | 99723ee4be22a614dcf49e1bffbe264956a5bb8e /source/gameengine | |
parent | f9fbfd9297aba0b46d6942c53dee6617ef0d7312 (diff) |
remove redundant argument from mathutils callbacks
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 70 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ObjectActuator.cpp | 28 |
2 files changed, 49 insertions, 49 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 776207ef209..e5fb78daceb 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1261,7 +1261,7 @@ static int mathutils_kxgameob_generic_check(BaseMathObject *bmo) return 1; } -static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype, float *vec_from) +static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype) { KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); if(self==NULL) @@ -1269,39 +1269,39 @@ static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype, float switch(subtype) { case MATHUTILS_VEC_CB_POS_LOCAL: - self->NodeGetLocalPosition().getValue(vec_from); + self->NodeGetLocalPosition().getValue(bmo->data); break; case MATHUTILS_VEC_CB_POS_GLOBAL: - self->NodeGetWorldPosition().getValue(vec_from); + self->NodeGetWorldPosition().getValue(bmo->data); break; case MATHUTILS_VEC_CB_SCALE_LOCAL: - self->NodeGetLocalScaling().getValue(vec_from); + self->NodeGetLocalScaling().getValue(bmo->data); break; case MATHUTILS_VEC_CB_SCALE_GLOBAL: - self->NodeGetWorldScaling().getValue(vec_from); + self->NodeGetWorldScaling().getValue(bmo->data); break; case MATHUTILS_VEC_CB_INERTIA_LOCAL: if(!self->GetPhysicsController()) return 0; - self->GetPhysicsController()->GetLocalInertia().getValue(vec_from); + self->GetPhysicsController()->GetLocalInertia().getValue(bmo->data); break; case MATHUTILS_VEC_CB_OBJECT_COLOR: - self->GetObjectColor().getValue(vec_from); + self->GetObjectColor().getValue(bmo->data); break; case MATHUTILS_VEC_CB_LINVEL_LOCAL: if(!self->GetPhysicsController()) return 0; - self->GetLinearVelocity(true).getValue(vec_from); + self->GetLinearVelocity(true).getValue(bmo->data); break; case MATHUTILS_VEC_CB_LINVEL_GLOBAL: if(!self->GetPhysicsController()) return 0; - self->GetLinearVelocity(false).getValue(vec_from); + self->GetLinearVelocity(false).getValue(bmo->data); break; case MATHUTILS_VEC_CB_ANGVEL_LOCAL: if(!self->GetPhysicsController()) return 0; - self->GetAngularVelocity(true).getValue(vec_from); + self->GetAngularVelocity(true).getValue(bmo->data); break; case MATHUTILS_VEC_CB_ANGVEL_GLOBAL: if(!self->GetPhysicsController()) return 0; - self->GetAngularVelocity(false).getValue(vec_from); + self->GetAngularVelocity(false).getValue(bmo->data); break; } @@ -1309,7 +1309,7 @@ static int mathutils_kxgameob_vector_get(BaseMathObject *bmo, int subtype, float return 1; } -static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype, float *vec_to) +static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype) { KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); if(self==NULL) @@ -1317,15 +1317,15 @@ static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype, float switch(subtype) { case MATHUTILS_VEC_CB_POS_LOCAL: - self->NodeSetLocalPosition(MT_Point3(vec_to)); + self->NodeSetLocalPosition(MT_Point3(bmo->data)); self->NodeUpdateGS(0.f); break; case MATHUTILS_VEC_CB_POS_GLOBAL: - self->NodeSetWorldPosition(MT_Point3(vec_to)); + self->NodeSetWorldPosition(MT_Point3(bmo->data)); self->NodeUpdateGS(0.f); break; case MATHUTILS_VEC_CB_SCALE_LOCAL: - self->NodeSetLocalScale(MT_Point3(vec_to)); + self->NodeSetLocalScale(MT_Point3(bmo->data)); self->NodeUpdateGS(0.f); break; case MATHUTILS_VEC_CB_SCALE_GLOBAL: @@ -1334,46 +1334,46 @@ static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype, float /* read only */ break; case MATHUTILS_VEC_CB_OBJECT_COLOR: - self->SetObjectColor(MT_Vector4(vec_to)); + self->SetObjectColor(MT_Vector4(bmo->data)); break; case MATHUTILS_VEC_CB_LINVEL_LOCAL: - self->setLinearVelocity(MT_Point3(vec_to),true); + self->setLinearVelocity(MT_Point3(bmo->data),true); break; case MATHUTILS_VEC_CB_LINVEL_GLOBAL: - self->setLinearVelocity(MT_Point3(vec_to),false); + self->setLinearVelocity(MT_Point3(bmo->data),false); break; case MATHUTILS_VEC_CB_ANGVEL_LOCAL: - self->setAngularVelocity(MT_Point3(vec_to),true); + self->setAngularVelocity(MT_Point3(bmo->data),true); break; case MATHUTILS_VEC_CB_ANGVEL_GLOBAL: - self->setAngularVelocity(MT_Point3(vec_to),false); + self->setAngularVelocity(MT_Point3(bmo->data),false); break; } return 1; } -static int mathutils_kxgameob_vector_get_index(BaseMathObject *bmo, int subtype, float *vec_from, int index) +static int mathutils_kxgameob_vector_get_index(BaseMathObject *bmo, int subtype, int index) { float f[4]; /* lazy, avoid repeteing the case statement */ - if(!mathutils_kxgameob_vector_get(bmo, subtype, f)) + if(!mathutils_kxgameob_vector_get(bmo, subtype)) return 0; - vec_from[index]= f[index]; + bmo->data[index]= f[index]; return 1; } -static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype, float *vec_to, int index) +static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype, int index) { - float f= vec_to[index]; + float f= bmo->data[index]; /* lazy, avoid repeteing the case statement */ - if(!mathutils_kxgameob_vector_get(bmo, subtype, vec_to)) + if(!mathutils_kxgameob_vector_get(bmo, subtype)) return 0; - vec_to[index]= f; - mathutils_kxgameob_vector_set(bmo, subtype, vec_to); + bmo->data[index]= f; + mathutils_kxgameob_vector_set(bmo, subtype); return 1; } @@ -1392,18 +1392,18 @@ Mathutils_Callback mathutils_kxgameob_vector_cb = { static int mathutils_kxgameob_matrix_cb_index= -1; /* index for our callbacks */ -static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype, float *mat_from) +static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype) { KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); if(self==NULL) return 0; - + switch(subtype) { case MATHUTILS_MAT_CB_ORI_LOCAL: - self->NodeGetLocalOrientation().getValue3x3(mat_from); + self->NodeGetLocalOrientation().getValue3x3(bmo->data); break; case MATHUTILS_MAT_CB_ORI_GLOBAL: - self->NodeGetWorldOrientation().getValue3x3(mat_from); + self->NodeGetWorldOrientation().getValue3x3(bmo->data); break; } @@ -1411,7 +1411,7 @@ static int mathutils_kxgameob_matrix_get(BaseMathObject *bmo, int subtype, float } -static int mathutils_kxgameob_matrix_set(BaseMathObject *bmo, int subtype, float *mat_to) +static int mathutils_kxgameob_matrix_set(BaseMathObject *bmo, int subtype) { KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(bmo->cb_user); if(self==NULL) @@ -1420,12 +1420,12 @@ static int mathutils_kxgameob_matrix_set(BaseMathObject *bmo, int subtype, float MT_Matrix3x3 mat3x3; switch(subtype) { case MATHUTILS_MAT_CB_ORI_LOCAL: - mat3x3.setValue3x3(mat_to); + mat3x3.setValue3x3(bmo->data); self->NodeSetLocalOrientation(mat3x3); self->NodeUpdateGS(0.f); break; case MATHUTILS_MAT_CB_ORI_GLOBAL: - mat3x3.setValue3x3(mat_to); + mat3x3.setValue3x3(bmo->data); self->NodeSetLocalOrientation(mat3x3); self->NodeUpdateGS(0.f); break; diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 824017f5704..460e4369c5b 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -392,7 +392,7 @@ static int mathutils_obactu_generic_check(BaseMathObject *bmo) return 1; } -static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype, float *vec_from) +static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype) { KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); if(self==NULL) @@ -400,17 +400,17 @@ static int mathutils_obactu_vector_get(BaseMathObject *bmo, int subtype, float * switch(subtype) { case MATHUTILS_VEC_CB_LINV: - self->m_linear_velocity.getValue(vec_from); + self->m_linear_velocity.getValue(bmo->data); break; case MATHUTILS_VEC_CB_ANGV: - self->m_angular_velocity.getValue(vec_from); + self->m_angular_velocity.getValue(bmo->data); break; } return 1; } -static int mathutils_obactu_vector_set(BaseMathObject *bmo, int subtype, float *vec_to) +static int mathutils_obactu_vector_set(BaseMathObject *bmo, int subtype) { KX_ObjectActuator* self= static_cast<KX_ObjectActuator*>BGE_PROXY_REF(bmo->cb_user); if(self==NULL) @@ -418,37 +418,37 @@ static int mathutils_obactu_vector_set(BaseMathObject *bmo, int subtype, float * switch(subtype) { case MATHUTILS_VEC_CB_LINV: - self->m_linear_velocity.setValue(vec_to); + self->m_linear_velocity.setValue(bmo->data); break; case MATHUTILS_VEC_CB_ANGV: - self->m_angular_velocity.setValue(vec_to); + self->m_angular_velocity.setValue(bmo->data); break; } return 1; } -static int mathutils_obactu_vector_get_index(BaseMathObject *bmo, int subtype, float *vec_from, int index) +static int mathutils_obactu_vector_get_index(BaseMathObject *bmo, int subtype, int index) { float f[4]; /* lazy, avoid repeteing the case statement */ - if(!mathutils_obactu_vector_get(bmo, subtype, f)) + if(!mathutils_obactu_vector_get(bmo, subtype)) return 0; - vec_from[index]= f[index]; + bmo->data[index]= f[index]; return 1; } -static int mathutils_obactu_vector_set_index(BaseMathObject *bmo, int subtype, float *vec_to, int index) +static int mathutils_obactu_vector_set_index(BaseMathObject *bmo, int subtype, int index) { - float f= vec_to[index]; + float f= bmo->data[index]; /* lazy, avoid repeteing the case statement */ - if(!mathutils_obactu_vector_get(bmo, subtype, vec_to)) + if(!mathutils_obactu_vector_get(bmo, subtype)) return 0; - vec_to[index]= f; - mathutils_obactu_vector_set(bmo, subtype, vec_to); + bmo->data[index]= f; + mathutils_obactu_vector_set(bmo, subtype); return 1; } |