protected override void Awake()
        {
            base.Awake();

            m_coneHandlesPositions = GizmoUtility.GetConeHandlesPositions();
            m_coneHandesNormals    = GizmoUtility.GetConeHandlesNormals();
        }
 protected override void OnCommandBufferRefresh(IRTECamera camera)
 {
     base.OnCommandBufferRefresh(camera);
     if (Target == null)
     {
         return;
     }
     GizmoUtility.DrawDirectionalLight(camera.CommandBuffer, camera.Camera, Target.position, Target.rotation, Vector3.one, LineProperties);
 }
Ejemplo n.º 3
0
        protected override void AwakeOverride()
        {
            base.AwakeOverride();
            m_handlesPositions = GizmoUtility.GetHandlesPositions();
            m_handlesNormals   = GizmoUtility.GetHandlesNormals();

            m_lineProperties      = new MaterialPropertyBlock();
            m_handleProperties    = new MaterialPropertyBlock();
            m_selectionProperties = new MaterialPropertyBlock();
        }
Ejemplo n.º 4
0
        protected override void OnCommandBufferRefresh(IRTECamera camera)
        {
            base.OnCommandBufferRefresh(camera);

            GizmoUtility.DrawConeHandles(camera.CommandBuffer, Target.TransformPoint(Vector3.forward * Height), Target.rotation, Scale, LineProperties);
            GizmoUtility.DrawWireCone(camera.CommandBuffer, Height, Radius, Target.position, Target.rotation, Vector3.one, LineProperties);
            if (IsDragging)
            {
                GizmoUtility.DrawSelection(camera.CommandBuffer, Target.TransformPoint(Vector3.forward * Height + Vector3.Scale(HandlesPositions[DragIndex], Scale)), Target.rotation, Scale, SelectionProperties);
            }
        }
Ejemplo n.º 5
0
        protected override void OnCommandBufferRefresh(IRTECamera camera)
        {
            base.OnCommandBufferRefresh(camera);
            float   hs    = GetMaxHorizontalScale(true);
            Vector3 scale = GetHandlesScale(true);

            GizmoUtility.DrawCubeHandles(camera.CommandBuffer, Target.TransformPoint(Center), Target.rotation, scale, HandleProperties);
            GizmoUtility.DrawWireCapsule(camera.CommandBuffer, Direction, GetHeight(), Radius, Target.TransformPoint(Center), Target.rotation, new Vector3(hs, hs, hs), LineProperties);
            if (IsDragging)
            {
                GizmoUtility.DrawSelection(camera.CommandBuffer, HandlesTransform.MultiplyPoint(HandlesPositions[DragIndex]), Target.rotation, Target.lossyScale, SelectionProperties);
            }
        }
Ejemplo n.º 6
0
        protected override void OnCommandBufferRefresh(IRTECamera camera)
        {
            base.OnCommandBufferRefresh(camera);

            Bounds  bounds      = Bounds;
            Vector3 parentScale = Target.parent == null ? Vector3.one : Target.parent.lossyScale;
            Vector3 scale       = Vector3.Scale(Vector3.Scale(bounds.extents, Target.localScale), parentScale);

            GizmoUtility.DrawCubeHandles(camera.CommandBuffer, Target.TransformPoint(bounds.center), Target.rotation, scale, HandleProperties);
            GizmoUtility.DrawWireCube(camera.CommandBuffer, bounds, Target.TransformPoint(bounds.center), Target.rotation, Target.lossyScale, LineProperties);

            if (IsDragging)
            {
                GizmoUtility.DrawSelection(camera.CommandBuffer, Target.TransformPoint(bounds.center + Vector3.Scale(HandlesPositions[DragIndex], bounds.extents)), Target.rotation, Target.lossyScale, SelectionProperties);
            }
        }
Ejemplo n.º 7
0
        protected override void OnCommandBufferRefresh(IRTECamera camera)
        {
            base.OnCommandBufferRefresh(camera);
            if (Target == null)
            {
                return;
            }

            Vector3 scale = Target.lossyScale * Radius;

            scale = Vector3.one * Mathf.Max(Mathf.Abs(scale.x), Mathf.Abs(scale.y), Mathf.Abs(scale.z));

            GizmoUtility.DrawCubeHandles(camera.CommandBuffer, Target.TransformPoint(Center), Target.rotation, scale, HandleProperties);
            GizmoUtility.DrawWireSphere(camera.CommandBuffer, camera.Camera, Target.TransformPoint(Center), Target.rotation, scale, LineProperties);

            if (IsDragging)
            {
                scale = Target.lossyScale;
                scale = Vector3.one * Mathf.Max(Mathf.Abs(scale.x), Mathf.Abs(scale.y), Mathf.Abs(scale.z));

                GizmoUtility.DrawSelection(camera.CommandBuffer, HandlesTransform.MultiplyPoint(Center + HandlesPositions[DragIndex]), Target.rotation, scale, SelectionProperties);
            }
        }