コード例 #1
0
        public TranslateAction(GLTransform transform)
        {
            Transform = transform;

            float boxLength    = 2.0f + 1.0F;
            float boxHalfWidth = 0.25f;

            var xBounding = new AxisAlignedBoundingBox(new Vector3(0, -boxHalfWidth, -boxHalfWidth), new Vector3(boxLength, boxHalfWidth, boxHalfWidth));
            var yBounding = new AxisAlignedBoundingBox(new Vector3(-boxHalfWidth, 0, -boxHalfWidth), new Vector3(boxHalfWidth, boxLength, boxHalfWidth));
            var zBounding = new AxisAlignedBoundingBox(new Vector3(-boxHalfWidth, -boxHalfWidth, 0), new Vector3(boxHalfWidth, boxHalfWidth, boxLength));

            AxisOjects = new List <AxisAlignedBoundingBox>()
            {
                xBounding, yBounding, zBounding,
            };
        }
コード例 #2
0
        public void SetTransformAction(GLTransform transform, TransformActions action)
        {
            switch (action)
            {
            case TransformActions.Translate: ActiveAction = new TranslateAction(transform); break;
            }

            if (action.HasFlag(TransformActions.X))
            {
                ActiveAction.ActiveAxis = Axis.X;
            }
            if (action.HasFlag(TransformActions.Y))
            {
                ActiveAction.ActiveAxis = Axis.Y;
            }
            if (action.HasFlag(TransformActions.Z))
            {
                ActiveAction.ActiveAxis = Axis.Z;
            }
        }