示例#1
0
        protected override void OnLoad()
        {
            // Add a collision object for each figure node.
            foreach (var figureNode in _scene.GetDescendants().OfType <FigureNode>())
            {
                var geometricObject = new FigureGeometricObject
                {
                    Shape      = figureNode.Figure.HitShape,
                    Scale      = figureNode.ScaleWorld,
                    Pose       = figureNode.PoseWorld,
                    FigureNode = figureNode,
                };
                var collisionObject = new CollisionObject(geometricObject);
                _collisionDomain.CollisionObjects.Add(collisionObject);
            }

            _collisionDomain.CollisionObjects.Add(_pickingObject);
        }
示例#2
0
        protected override void OnLoad()
        {
            // Add a collision object for each figure node.
            foreach (var figureNode in _scene.GetDescendants().OfType<FigureNode>())
            {
                var geometricObject = new FigureGeometricObject
                {
                    Shape = figureNode.Figure.HitShape,
                    Scale = figureNode.ScaleWorld,
                    Pose = figureNode.PoseWorld,
                    FigureNode = figureNode,
                };
                var collisionObject = new CollisionObject(geometricObject);
                _collisionDomain.CollisionObjects.Add(collisionObject);
            }

            _collisionDomain.CollisionObjects.Add(_pickingObject);
        }