void OnRenderObject() { if (Root == null) { Root = transform; } /* * UnityGL.Start(); * UnityGL.DrawGUICircle(0.5f, 0.85f, 0.075f, Utility.Black.Transparent(0.5f)); * Quaternion rotation = Quaternion.AngleAxis(-360f * Phase / (2f * Mathf.PI), Vector3.forward); * Vector2 a = rotation * new Vector2(-0.005f, 0f); * Vector2 b = rotation *new Vector3(0.005f, 0f); * Vector3 c = rotation * new Vector3(0f, 0.075f); * UnityGL.DrawGUITriangle(0.5f + a.x/Screen.width*Screen.height, 0.85f + a.y, 0.5f + b.x/Screen.width*Screen.height, 0.85f + b.y, 0.5f + c.x/Screen.width*Screen.height, 0.85f + c.y, Utility.Cyan); * UnityGL.Finish(); */ if (ShowTrajectory) { if (Application.isPlaying) { UltiDraw.Begin(); UltiDraw.DrawLine(Trajectory.Points[RootPointIndex].GetPosition(), Trajectory.Points[RootPointIndex].GetPosition() + TargetDirection, 0.05f, 0f, UltiDraw.Red.Transparent(0.75f)); UltiDraw.DrawLine(Trajectory.Points[RootPointIndex].GetPosition(), Trajectory.Points[RootPointIndex].GetPosition() + TargetVelocity, 0.05f, 0f, UltiDraw.Green.Transparent(0.75f)); UltiDraw.End(); Trajectory.Draw(10); } } if (!Application.isPlaying) { Character.FetchTransformations(Root); } Character.Draw(); if (ShowVelocities) { if (Application.isPlaying) { UltiDraw.Begin(); for (int i = 0; i < Joints.Length; i++) { Character.Segment segment = Character.FindSegment(Joints[i].name); if (segment != null) { UltiDraw.DrawArrow( Joints[i].position, Joints[i].position + Velocities[i] * 60f, 0.75f, 0.0075f, 0.05f, UltiDraw.Cyan.Transparent(0.5f) ); } } UltiDraw.End(); } } }
void OnRenderObject() { if (Root == null) { Root = transform; } if (ShowTrajectory) { if (Application.isPlaying) { UltiDraw.Begin(); UltiDraw.DrawLine(Trajectory.Points[RootPointIndex].GetPosition(), Trajectory.Points[RootPointIndex].GetPosition() + TargetDirection, 0.05f, 0f, UltiDraw.Red.Transparent(0.75f)); UltiDraw.DrawLine(Trajectory.Points[RootPointIndex].GetPosition(), Trajectory.Points[RootPointIndex].GetPosition() + TargetVelocity, 0.05f, 0f, UltiDraw.Green.Transparent(0.75f)); UltiDraw.End(); Trajectory.Draw(10); } } if (!Application.isPlaying) { Character.FetchTransformations(Root); } Character.Draw(); if (ShowVelocities) { if (Application.isPlaying) { UltiDraw.Begin(); for (int i = 0; i < Joints.Length; i++) { Character.Segment segment = Character.FindSegment(Joints[i].name); if (segment != null) { UltiDraw.DrawArrow( Joints[i].position, Joints[i].position + Velocities[i] * 60f, 0.75f, 0.0075f, 0.05f, UltiDraw.Purple.Transparent(0.5f) ); } } UltiDraw.End(); } } }
void OnRenderObject() { if (ShowTrajectory) { if (Application.isPlaying) { //UltiDraw.Begin(); //UltiDraw.DrawLine(Trajectory.Points[RootPointIndex].GetPosition(), Trajectory.Points[RootPointIndex].GetPosition() + TargetDirection, 0.05f, 0f, UltiDraw.Orange.Transparent(0.75f)); //UltiDraw.DrawLine(Trajectory.Points[RootPointIndex].GetPosition(), Trajectory.Points[RootPointIndex].GetPosition() + TargetVelocity, 0.05f, 0f, UltiDraw.Green.Transparent(0.75f)); //UltiDraw.End(); Trajectory.Draw(10); } } if (Application.isPlaying) { /* * for(int i=5; i<6; i++) { * for(int j=0; j<Character.Hierarchy.Length; j++) { * Matrix4x4 mat = Matrix4x4.TRS(PastPositions[j][i*10], Quaternion.LookRotation(PastForwards[j][i*10], PastUps[j][i*10]), Vector3.one); * Character.Hierarchy[j].SetTransformation(mat); * } * Character.DrawSimple(Color.Lerp(UltiDraw.Blue, UltiDraw.Cyan, 1f - (float)(i+1)/6f).Transparent(0.75f)); * } */ /* * for(int i=0; i<5; i++) { * for(int j=0; j<Character.Hierarchy.Length; j++) { * Matrix4x4 mat = Matrix4x4.TRS(FuturePositions[j][i], Quaternion.LookRotation(FutureForwards[j][i], FutureUps[j][i]), Vector3.one); * Character.Hierarchy[j].SetTransformation(mat); * } * Character.DrawSimple(Color.Lerp(UltiDraw.Red, UltiDraw.Orange, (float)(i+1)/5f).Transparent(0.75f)); * } */ } Character.FetchTransformations(transform); Character.Draw(); if (ShowVelocities) { if (Application.isPlaying) { UltiDraw.Begin(); for (int i = 0; i < Joints.Length; i++) { Character.Segment segment = Character.FindSegment(Joints[i].name); if (segment != null) { UltiDraw.DrawArrow( Joints[i].position, Joints[i].position + Velocities[i], 0.75f, 0.0075f, 0.05f, UltiDraw.Purple.Transparent(0.5f) ); } } UltiDraw.End(); } } }