private static FlipperVelocityData GetVelocityData(FlipperStaticData d) { return(new FlipperVelocityData { AngularAcceleration = 0f, ContactTorque = 0f, CurrentTorque = 0f, Direction = d.AngleEnd >= d.AngleStart, IsInContact = false }); }
private FlipperMovementData GetMovementData(FlipperStaticData d) { // store flipper base rotation without starting angle var baseRotation = math.normalize(math.mul( math.normalize(transform.rotation), quaternion.EulerXYZ(0, 0, -d.AngleStart) )); return(new FlipperMovementData { Angle = d.AngleStart, AngleSpeed = 0f, AngularMomentum = 0f, EnableRotateEvent = 0, BaseRotation = baseRotation, }); }