public AxisAlignedBoundingBox ComputeWorldAABB(Matrix4x4 worldTransform)
        {
            // compute projected poly's bounds in sector-local space.
            var boundsWorld = ComputeExtrudedBoundsLocal().Map(
                p => Vector3.Transform(p, worldTransform)
                .ToOpenMobaVector());

            return(AxisAlignedBoundingBox.BoundingPoints(boundsWorld));
        }
Exemplo n.º 2
0
        public AxisAlignedBoundingBox ComputeWorldAABB(Matrix4x4 worldTransform)
        {
            // todo: can we do this more efficiently?
            var corners = new[] {
                new Vector3(-Radius, -Radius, -Radius),
                new Vector3(-Radius, -Radius, Radius),
                new Vector3(-Radius, Radius, -Radius),
                new Vector3(-Radius, Radius, Radius),
                new Vector3(Radius, -Radius, -Radius),
                new Vector3(Radius, -Radius, Radius),
                new Vector3(Radius, Radius, -Radius),
                new Vector3(Radius, Radius, Radius)
            };

            return(AxisAlignedBoundingBox.BoundingPoints(corners.Map(p => Vector3.Transform(p, worldTransform).ToOpenMobaVector())));
        }