Exemple #1
0
        public BoundingBoxRenderableComponent(IVeldridShaderSpecification shader, DeviceBufferesUpdater deviceBufferes, BoundingBox box)
            : base(shader, deviceBufferes)
        {
            EntityTag = new ElementTag("BoundingBox");
            Box       = box;
            geometry  = new Geometry3D();
            var corners = box.GetCorners();

            var points = new List <Vector3>()
            {
                corners.NearBottomLeft,
                corners.NearBottomRight,
                corners.NearTopLeft,
                corners.NearTopRight,
                corners.FarBottomLeft,
                corners.FarBottomRight,
                corners.FarTopLeft,
                corners.FarTopRight
            };

            geometry.Positions = points;
            var index = 0;

            geometry.Indices = new List <int>(geometry.Positions.Select(x => index++));

            var lb = new Std.Engine.Helpers.LineBuilder();

            geometry = lb.Build(points);
        }
Exemple #2
0
 protected ShaderComponent(IVeldridShaderSpecification shader, DeviceBufferesUpdater deviceBufferes)
 {
     Shader    = shader;
     Bufferes  = deviceBufferes;
     Resources = new ResourcesUpdater(Shader.GetResourceDescription());
 }
Exemple #3
0
 public LineGeometryRenderComponent(IVeldridShaderSpecification shader, DeviceBufferesUpdater deviceBufferes, Geometry3D geometry) : base(shader, deviceBufferes)
 {
     this.Geometry = geometry;
 }