Class Qube
Represents a cube-shaped game element with customizable appearance.
Inherited Members
Namespace: Genesis.Core.GameElements
Assembly: Genesis.dll
Syntax
public class Qube : GameElement
Constructors
Qube(string, Vec3)
Initializes a new instance of the cube class with default settings.
Declaration
public Qube(string name, Vec3 location)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the cube. |
Vec3 | location | The initial location of the cube. |
Qube(string, Vec3, Vec3)
Initializes a new instance of the cube class with specified size.
Declaration
public Qube(string Name, Vec3 location, Vec3 size)
Parameters
Type | Name | Description |
---|---|---|
string | Name | |
Vec3 | location | The initial location of the cube. |
Vec3 | size | The size of the cube. |
Qube(string, Vec3, Vec3, Vec3)
Initializes a new instance of the cube class with specified size and rotation.
Declaration
public Qube(string name, Vec3 location, Vec3 size, Vec3 rotation)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the cube. |
Vec3 | location | The initial location of the cube. |
Vec3 | size | The size of the cube. |
Vec3 | rotation | The initial rotation of the cube. |
Properties
Color
Gets or sets the color of the cube.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Color |
Material
Gets or sets the material for this cube
Declaration
public Material Material { get; set; }
Property Value
Type | Description |
---|---|
Material |
Shader
Gets or sets the shader program associated with this cube.
Declaration
public ShaderProgram Shader { get; set; }
Property Value
Type | Description |
---|---|
ShaderProgram |
Shape
Gets or sets the cube shape definition.
Declaration
public QubeShape Shape { get; set; }
Property Value
Type | Description |
---|---|
QubeShape |
Methods
CreateInstanceContainer(Material, bool)
Declaration
public static RenderInstanceContainer CreateInstanceContainer(Material material, bool updateInstances = false)
Parameters
Type | Name | Description |
---|---|---|
Material | material | |
bool | updateInstances |
Returns
Type | Description |
---|---|
RenderInstanceContainer |
GetColors(Color)
Gets an array of color values based on the specified color.
Declaration
public static float[] GetColors(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color for the cube faces. |
Returns
Type | Description |
---|---|
float[] | An array of color values for the cube faces. |
GetTextureCoordinates(float, float, float)
Declaration
public static float[] GetTextureCoordinates(float width, float height, float depth)
Parameters
Type | Name | Description |
---|---|---|
float | width | |
float | height | |
float | depth |
Returns
Type | Description |
---|---|
float[] |
Init(Game, IRenderDevice)
Initializes the game element.
Declaration
public override void Init(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |
Overrides
OnDestroy(Game)
Called when the game element is disposed.
Declaration
public override void OnDestroy(Game game)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
Overrides
OnRender(Game, IRenderDevice)
Renders the game element.
Declaration
public override void OnRender(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |
Overrides
ToRenderInstance()
Declaration
public RenderInstanceContainer ToRenderInstance()
Returns
Type | Description |
---|---|
RenderInstanceContainer |