예제 #1
0
파일: ScaleGizmo.cs 프로젝트: xorza/NetGL
        private void SetPlanes()
        {
            _xyzPlane = new Plane(Vector3.One.Normalized, -CrossInner / MathF.Sqrt(3));
            _xyPlane  = new Plane(Vector3.UnitZ, 0);
            _xzPlane  = new Plane(Vector3.UnitY, 0);
            _yzPlane  = new Plane(Vector3.UnitX, 0);

            _xBox = new Box(new Vector3(0.5f, 0, 0), new Vector3(1, ColliderWidth, ColliderWidth));
            _yBox = new Box(new Vector3(0, 0.5f, 0), new Vector3(ColliderWidth, 1, ColliderWidth));
            _zBox = new Box(new Vector3(0, 0, 0.5f), new Vector3(ColliderWidth, ColliderWidth, 1));
        }
예제 #2
0
        private void AddColliders()
        {
            _xBox = new Box(new Vector3(0.5f, 0, 0), new Vector3(1, ColliderWidth, ColliderWidth));
            _yBox = new Box(new Vector3(0, 0.5f, 0), new Vector3(ColliderWidth, 1, ColliderWidth));
            _zBox = new Box(new Vector3(0, 0, 0.5f), new Vector3(ColliderWidth, ColliderWidth, 1));

            var offset = CrossMid - CrossSize / 2;

            _xyBox = new Box(new Vector3(offset, offset, 0), new Vector3(CrossSize, CrossSize, 0));
            _xzBox = new Box(new Vector3(offset, 0, offset), new Vector3(CrossSize, 0, CrossSize));
            _yzBox = new Box(new Vector3(0, offset, offset), new Vector3(0, CrossSize, CrossSize));
        }