C# 클래스 ByChance.Levels3D.Chunk3D

Main building block that makes up a 3D level, providing extents, position and rotation.

Chunks are created based on pre-defined chunk templates and define the positions of all contexts and anchors associated with the chunk, as well as attributes that are required for the level generation process such as the probability of a chunk being picked to be added next.

상속: ByChance.Core.Chunk
파일 보기 프로젝트 열기: npruehs/bychance

공개 메소드들

메소드 설명
Chunk3D ( ChunkTemplate chunkTemplate ) : System

Constructs a new chunk with a reference to the passed chunk template, using that template's width, height and depth and performing deep copies of the lists of contexts and anchors of that template.

ToString ( ) : string

Returns the position of this chunk within the level as string.

비공개 메소드들

메소드 설명
Rotate ( ) : bool

Rotates this chunk according to the following rules: The chunk is rotated by 90° around the y-axis. If the chunk has been rotated by 360° around the y-axis, it is rotated by 90° around the x-axis after. If the chunk has been rotated by 360° around the x-axis, it is rotated by 90° around the z-axis after. The positions of all contexts are changed accordingly, and width, height and depth are switched as appropriate.

RotateX ( ) : bool

Rotates this chunk by 90° around the x-axis, changing the positions of all contexts and switching height and depth. If the chunk has been rotated by 360° around the x-axis, it is rotated by 90° around the z-axis after.

RotateY ( ) : bool

Rotates this chunk by 90° around the y-axis, changing the positions of all contexts and switching width and depth. If the chunk has been rotated by 360° around the y-axis, it is rotated by 90° around the x-axis after.

RotateZ ( ) : bool

Rotates this chunk by 90° around the z-axis, changing the positions of all contexts and switching width and height.

SetPosition ( Vector3F position ) : void

Sets the position of this chunk within the level and changes the relative positions of all anchors of this chunk to match its rotation.

메소드 상세

Chunk3D() 공개 메소드

Constructs a new chunk with a reference to the passed chunk template, using that template's width, height and depth and performing deep copies of the lists of contexts and anchors of that template.
is null. Passed template is not of the type .
public Chunk3D ( ChunkTemplate chunkTemplate ) : System
chunkTemplate ByChance.Core.ChunkTemplate Chunk template the new chunk will be based on.
리턴 System

ToString() 공개 메소드

Returns the position of this chunk within the level as string.
public ToString ( ) : string
리턴 string