bool result = false;
- KX_RayCast::RayTest(physics_environment, frompoint3, topoint3, KX_RayCast::Callback<KX_MouseFocusSensor>(this,physics_controller));
+ KX_RayCast::Callback<KX_MouseFocusSensor> callback(this,physics_controller);
+ KX_RayCast::RayTest(physics_environment, frompoint3, topoint3, callback);
result = (m_hitObject!=0);
PHY_IPhysicsEnvironment* physics_environment = this->m_scene->GetPhysicsEnvironment();
- KX_RayCast::RayTest(physics_environment, frompoint, topoint, KX_RayCast::Callback<KX_RaySensor>(this, spc));
+ KX_RayCast::Callback<KX_RaySensor> callback(this, spc);
+ KX_RayCast::RayTest(physics_environment, frompoint, topoint, callback);
/* now pass this result to some controller */