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);
 }
示例#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();
        }
示例#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);
            }
        }
示例#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);
            }
        }
示例#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);
            }
        }
        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);
            }
        }