@@ -136,18 +136,8 @@ void KX_RadarSensor::SynchronizeTransform()
136136
137137	mt::mat3x4 trans (rot, pos + rot * mt::vec3 (0 , -m_coneheight / 2 .0f , 0 ));
138138
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 );
151141
152142	if  (m_physCtrl) {
153143		PHY_IMotionState *motionState = m_physCtrl->GetMotionState ();
@@ -194,8 +184,8 @@ PyMethodDef KX_RadarSensor::Methods[] = {
194184};
195185
196186PyAttributeDef 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 ),
199189	EXP_PYATTRIBUTE_FLOAT_RO (" distance"  , KX_RadarSensor, m_coneheight),
200190	EXP_PYATTRIBUTE_RO_FUNCTION (" angle"  , KX_RadarSensor, pyattr_get_angle),
201191	EXP_PYATTRIBUTE_INT_RW (" axis"  , 0 , 5 , true , KX_RadarSensor, m_axis),
0 commit comments