Collection of static meshes to be rendered, makes it easier rendering complex things like
Levels, 3D Models with animation and collections of meshes. Should be combined with Actor.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Entities Entity
DeltaEngine.Entities DrawableEntity
DeltaEngine.Rendering3D Entity3D
DeltaEngine.Rendering3D HierarchyEntity3D
DeltaEngine.Rendering3D Model
DeltaEngine.Rendering3D.Shapes Box
Namespace: DeltaEngine.Rendering3D
Assembly: DeltaEngine.Rendering3D (in DeltaEngine.Rendering3D.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Model type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Model(String, Vector3D) | Initializes a new instance of the Model class | |
Model(ModelData, Vector3D) | Initializes a new instance of the Model class | |
Model(ModelData, Vector3D, Quaternion) | Initializes a new instance of the Model class |
Methods
Fields
Name | Description | |
---|---|---|
components | (Inherited from Entity.) | |
lastOrientation | (Inherited from Entity3D.) | |
lastPosition | (Inherited from Entity3D.) | |
lastTickLerpComponents |
Each element can either be a Lerp, a Lerp List or an array of Lerp objects.
View code on GitHub (Inherited from DrawableEntity.) |
Properties
Name | Description | |
---|---|---|
Children | (Inherited from HierarchyEntity3D.) | |
IsActive | (Inherited from HierarchyEntity3D.) | |
IsPauseable | (Inherited from Entity.) | |
IsVisible | (Inherited from DrawableEntity.) | |
NumberOfComponents | (Inherited from Entity.) | |
Orientation | (Inherited from Entity3D.) | |
Parent | (Inherited from HierarchyEntity3D.) | |
Position | (Inherited from Entity3D.) | |
RelativeOrientation | (Inherited from HierarchyEntity3D.) | |
RelativePosition | (Inherited from HierarchyEntity3D.) | |
RenderLayer | (Inherited from DrawableEntity.) | |
Scale | (Inherited from Entity3D.) | |
UpdatePriority | (Inherited from Entity.) |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void LoadInvalidModel() { if (IsMockResolver) Assert.Throws<ModelData.NoMeshesGivenNeedAtLeastOne>( () => new Model("InvalidModel", Vector3D.Zero)); }
[Test, ApproveFirstFrameScreenshot] public void RenderCubeModel() { window.BackgroundColor = Color.Gray; Camera.Current.Position = 2 * Vector3D.One; new Model("Cube", Vector3D.Zero); }
[Test] public void RayPick() { new Grid3D(new Size(10)); Camera.Current.Position = 5 * Vector3D.One; var cube = new Model(new ModelData(new BoxMesh(Vector3D.One, Color.Red)), Vector3D.Zero); var floor = new Plane(Vector3D.UnitZ, 0.0f); //ncrunch: no coverage start new Command(point => { var ray = Camera.Current.ScreenPointToRay(point); Vector3D? intersect = floor.Intersect(ray); if (intersect != null) cube.Position = (Vector3D)intersect; }).Add(new MouseButtonTrigger(MouseButton.Left, State.Pressed)); }
See Also