저번에 udp로 덤프 뜬거랑은 패킷 구조가 맞는지 조차 모르겠어서 나중에 천천히 f1 2015 라도 깔아서 해봐야 할 듯.
모션 패킷에는
월드 좌표계에서의 위치/가속도/방향
중력가속도 횡/종/수직 <<
차량의 yaw/pitch/roll <<
정보로 구성된다.
struct CarMotionData { float m_worldPositionX; // World space X position float m_worldPositionY; // World space Y position float m_worldPositionZ; // World space Z position float m_worldVelocityX; // Velocity in world space X float m_worldVelocityY; // Velocity in world space Y float m_worldVelocityZ; // Velocity in world space Z int16 m_worldForwardDirX; // World space forward X direction (normalised) int16 m_worldForwardDirY; // World space forward Y direction (normalised) int16 m_worldForwardDirZ; // World space forward Z direction (normalised) int16 m_worldRightDirX; // World space right X direction (normalised) int16 m_worldRightDirY; // World space right Y direction (normalised) int16 m_worldRightDirZ; // World space right Z direction (normalised) float m_gForceLateral; // Lateral G-Force component float m_gForceLongitudinal; // Longitudinal G-Force component float m_gForceVertical; // Vertical G-Force component float m_yaw; // Yaw angle in radians float m_pitch; // Pitch angle in radians float m_roll; // Roll angle in radians };
CarMotionData m_carMotionData[22]; // Data for all cars on track
// Extra player car ONLY data float m_suspensionPosition[4]; // Note: All wheel arrays have the following order: float m_suspensionVelocity[4]; // RL, RR, FL, FR float m_suspensionAcceleration[4]; // RL, RR, FL, FR float m_wheelSpeed[4]; // Speed of each wheel float m_wheelSlip[4]; // Slip ratio for each wheel float m_localVelocityX; // Velocity in local space float m_localVelocityY; // Velocity in local space float m_localVelocityZ; // Velocity in local space float m_angularVelocityX; // Angular velocity x-component float m_angularVelocityY; // Angular velocity y-component float m_angularVelocityZ; // Angular velocity z-component float m_angularAccelerationX; // Angular velocity x-component float m_angularAccelerationY; // Angular velocity y-component float m_angularAccelerationZ; // Angular velocity z-component float m_frontWheelsAngle; // Current front wheels angle in radians };
Unopposed acceleration due to mechanical forces, and consequentially g-force, is experienced whenever anyone rides in a vehicle because it always causes a proper acceleration, and (in the absence of gravity) also always a coordinate acceleration (where velocity changes). Whenever the vehicle changes either direction or speed, the occupants feellateral (side to side)orlongitudinal (forward and backwards)forces produced by the mechanical push of their seats.
lon·gi·tu·di·nal /ˌlônjəˈto͞odənl,ˌlänjəˈto͞odənl/ adjective adjective: longitudinal 1. running lengthwise rather than across. "longitudinal muscles" 2. relating to longitude; measured from east to west. "longitudinal positions" 3. (of research or data) involving information about an individual or group gathered over a period of time. "a longitudinal study of ten patients"
그리고 대망(?)의 yaw / pitch / roll
비행기에서 많이 보던거긴한데 자동차도 이동방향에 대해서는 3개 축에 대한 회전값이 존재할 수 있으니까 머..