Hello. I have an issue with some velocity calculations and because my knowledge on how rotations works is limited i am struggling a bit. The project I’m working on its in VR.
So Im flying a drone in all direction and when I want to turn I just snap the ship X degrees, with AddControllerYawInput.
The hand are meshes that are a child of the ship so I moved them based on the controllers and also based on the ship so when the ship moves they move as well.
What I want is when I rotate the ship and the hand are rotating as well with it to find the velocity vector created by the rotation.
What I have in one function that I call once when the snap button is pressed:
AddControllerYawInput(45.0f);
float rotationPerSnap= 45; // Degrees of rotation per frame, the same as above
//I convert the degrees to radians and get the angular velocity vector
float YawRotationRadians = FMath::DegreesToRadians(rotationPerSnap);
FVector AngularVelocityVector = FVector(0.0f, 0.0f, YawRotationRadians);
//Here I try to get the vector from the middle of the ship to the hand so basically the radius
RightHandRadiusVector = rightHandMesh->GetComponentLocation() - shipMesh->GetComponentLocation();
LeftHandRadiusVector = leftHandMesh->GetComponentLocation() - shipMesh->GetComponentLocation();
//And from what Ive seen onlune this is the formula to get the linear velocity from the rotation:
RightHandLinearVelocityFromRot = FVector::CrossProduct(AngularVelocityVector, RightHandRadiusVector);
LeftHandLinearVelocityFromRot = FVector::CrossProduct(AngularVelocityVector, LeftHandRadiusVector);
The vectors I get are completelly wrong direction and size. Any tips ?