@@ -136,18 +136,8 @@ void KX_RadarSensor::SynchronizeTransform()
136
136
137
137
mt::mat3x4 trans (rot, pos + rot * mt::vec3 (0 , -m_coneheight / 2 .0f , 0 ));
138
138
139
- // Using a temp variable to translate mt::vec3 to float[3].
140
- // float[3] works better for the Python interface.
141
- mt::vec3 temp = trans.TranslationVector3D ();
142
- m_cone_origin[0 ] = temp[0 ];
143
- m_cone_origin[1 ] = temp[1 ];
144
- m_cone_origin[2 ] = temp[2 ];
145
-
146
- temp = trans * mt::vec3 (0 , -m_coneheight / 2 .0f , 0 );
147
- m_cone_target[0 ] = temp[0 ];
148
- m_cone_target[1 ] = temp[1 ];
149
- m_cone_target[2 ] = temp[2 ];
150
-
139
+ m_cone_origin = trans.TranslationVector3D ();
140
+ m_cone_target = trans * mt::vec3 (0 , -m_coneheight/2 .0f , 0 );
151
141
152
142
if (m_physCtrl) {
153
143
PHY_IMotionState *motionState = m_physCtrl->GetMotionState ();
@@ -194,8 +184,8 @@ PyMethodDef KX_RadarSensor::Methods[] = {
194
184
};
195
185
196
186
PyAttributeDef KX_RadarSensor::Attributes[] = {
197
- EXP_PYATTRIBUTE_FLOAT_ARRAY_RO (" coneOrigin" , KX_RadarSensor, m_cone_origin, 3 ),
198
- EXP_PYATTRIBUTE_FLOAT_ARRAY_RO (" coneTarget" , KX_RadarSensor, m_cone_target, 3 ),
187
+ EXP_PYATTRIBUTE_VECTOR_RO (" coneOrigin" , KX_RadarSensor, m_cone_origin, 3 ),
188
+ EXP_PYATTRIBUTE_VECTOR_RO (" coneTarget" , KX_RadarSensor, m_cone_target, 3 ),
199
189
EXP_PYATTRIBUTE_FLOAT_RO (" distance" , KX_RadarSensor, m_coneheight),
200
190
EXP_PYATTRIBUTE_RO_FUNCTION (" angle" , KX_RadarSensor, pyattr_get_angle),
201
191
EXP_PYATTRIBUTE_INT_RW (" axis" , 0 , 5 , true , KX_RadarSensor, m_axis),
0 commit comments