Skip to content
Snippets Groups Projects
Commit 6e3702bc authored by Paul-Walcher's avatar Paul-Walcher
Browse files

fixed cylinder rotation

parent 61daa62a
No related branches found
No related tags found
No related merge requests found
......@@ -32,15 +32,16 @@ protected void calculate_vectors(){
T = ((PointFact)FactRecorder.AllFacts[PidT]).Point + Vector3.zero;
//Rotation = Quaternion.LookRotation(forward, new Vector3(1.0F, 0.0F, 0.0F));
Position = M + ((T - M));
Position = T;
Radius = Vector3.Distance(M, E);
Height = Vector3.Distance(T, M);
LocalScale = new Vector3(Radius*2 + 0.1F, Height + 0.1F, Radius*2 + 0.1F);
Vector3 LookVector = E - M;
Vector3 bottomnormal = (T - M).normalized;
Vector3 rightvector = (E - M).normalized;
Rotation = Quaternion.LookRotation(LookVector, Vector3.up);
Rotation = Quaternion.LookRotation(rightvector, bottomnormal);
Volume = Mathf.PI * Radius * Radius * Height;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment