@@ -200,6 +200,12 @@ impl Wheel {
200
200
}
201
201
}
202
202
203
+ /// Information about suspension and the ground obtained from the ray-casting
204
+ /// for this wheel.
205
+ pub fn raycast_info ( & self ) -> & RayCastInfo {
206
+ & self . raycast_info
207
+ }
208
+
203
209
/// The world-space center of the wheel.
204
210
pub fn center ( & self ) -> Point < Real > {
205
211
self . center
@@ -216,15 +222,22 @@ impl Wheel {
216
222
}
217
223
}
218
224
225
+ /// Information about suspension and the ground obtained from the ray-casting
226
+ /// to simulate a wheel’s suspension.
219
227
#[ derive( Copy , Clone , Debug , PartialEq , Default ) ]
220
- struct RayCastInfo {
221
- // set by raycaster
222
- contact_normal_ws : Vector < Real > , //contact normal
223
- contact_point_ws : Point < Real > , //raycast hitpoint
224
- suspension_length : Real ,
225
- hard_point_ws : Point < Real > , //raycast starting point
226
- is_in_contact : bool ,
227
- ground_object : Option < ColliderHandle > ,
228
+ pub struct RayCastInfo {
229
+ /// The (world-space) contact normal between the wheel and the floor.
230
+ pub contact_normal_ws : Vector < Real > ,
231
+ /// The (world-space) point hit by the wheel’s ray-cast.
232
+ pub contact_point_ws : Point < Real > ,
233
+ /// The suspension length for the wheel.
234
+ pub suspension_length : Real ,
235
+ /// The (world-space) starting point of the ray-cast.
236
+ pub hard_point_ws : Point < Real > ,
237
+ /// Is the wheel in contact with the ground?
238
+ pub is_in_contact : bool ,
239
+ /// The collider hit by the ray-cast.
240
+ pub ground_object : Option < ColliderHandle > ,
228
241
}
229
242
230
243
impl DynamicRayCastVehicleController {
0 commit comments