ICRender
Index
Classes
CONDITIONinternal
Common superclass for all condition classes.
constructor
Parameters
ptr: number
Returns CONDITION
CollisionShape
Class representing custom collision shapes used for block.
constructor
Constructs a base model that will be raycasted in world.
Returns CollisionShape
addEntry
Adds new entry to the collision shape. You can then call CollisionEntry.setCondition to specify when to display the entry.
Returns CollisionEntry
clear
Returns void
getPtr
Returns number
Model
constructor
addEntry
Adds block model as an entry to the ICRender. You can then call RenderEntry.asCondition to specify when to display the entry.
Parameters
optionalmodel: Model
Returns RenderEntry
Created ICRender.RenderEntry object.
clear
Returns void
getPtr
Returns number
abstractRANDOM_CONDITION
Condition depending on random value.
constructor
Returns RANDOM_CONDITION
setAxisEnabled
Forces engine to treat blocks along some axis in same way if enabled parameter value is
false
.Parameters
axis: number
0 fpr x, 1 for y, 2 for z axis
enabled: boolean
Returns RANDOM_CONDITION
Interfaces
CollisionEntry
Object representing collision shape entry with it's displaying condition.
addBox
Adds new collision box to collision entry.
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
Returns CollisionEntry
Reference to itself to be used in sequential calls.
setCondition
Sets condition, all the boxes of the entry work only if the condition is
true
.Parameters
condition: CONDITION
Returns CollisionEntry
Reference to itself to be used in sequential calls.
Group
Groups (of blocks) are used to determine some render conditions; e.g., if a block exists on some relative coordinates, display some part of the model.
name
add
Adds a block to the group.
Parameters
id: number
block ID
data: number
block data or -1 to use with all registered data values
Returns void
getName
Returns string
Group's name.
RenderEntry
Object representing render entry with it's displaying condition.
asCondition
Sets ICRender.BLOCK condition with specified parameters. Uses coordinates that are relative to current block's ones.
Parameters
x: number
y: number
z: number
group: string | Group
group name or object
mode: number
one of the ICRender.MODE_INCLUDE and ICRender.MODE_EXCLUDE constants
Returns RenderEntry
Reference to itself to be used in sequential calls.
getParent
Returns Model
Parent ICRender.Model object this entry belongs to.
setCondition
Sets condition to be used for current entry.
Parameters
condition: CONDITION
Returns RenderEntry
Reference to itself to be used in sequential calls.
setMesh
Sets render mesh to be used for the entry.
Parameters
mesh: RenderMesh
Returns RenderEntry
Reference to itself to be used in sequential calls.
setModel
Sets block model used for the entry, specifying it's coordinates.
Parameters
x: number
y: number
z: number
model: Model
Returns RenderEntry
Reference to itself to be used in sequential calls.
Variables
constMODE_EXCLUDE
Used to specify that the block should be absent to satisfy condition.
constMODE_INCLUDE
Used to specify that the block should be present to satisfy condition.
Functions
AND
Constructs new ICRender.AND condition.
Parameters
rest...conditions: CONDITION[]
Returns CONDITION
BLOCK
Constructs new ICRender.BLOCK condition.
Parameters
x: number
is relative x coordinate
y: number
is relative y coordinate
z: number
is relative z coordinate
group: Group
blocks group to check the condition for
exclude: boolean
if true, the blocks from the group make the condition evaluate as false, as true otherwise
Returns CONDITION
BlockState
Constructs new ICRender.BlockState condition that uses block state data (it must match the value) to display.
Parameters
x: number
is relative x coordinate
y: number
is relative y coordinate
z: number
is relative z coordinate
state: number
one of EBlockStates values of relative block
value: number
value to match selected state
Returns CONDITION
NOT
Constructs new ICRender.NOT condition.
Parameters
condition: CONDITION
condition to be inverted
Returns CONDITION
OR
Constructs new ICRender.OR condition.
Parameters
rest...conditions: CONDITION[]
Returns CONDITION
RANDOM
Constructs new ICRender.RANDOM_CONDITION condition.
Parameters
value: number
value that a generated random integer number should be for the condition to evaluate as true
max: number
maximum value for the generator
optionalseed: number
seed to be used for random numbers generation
Returns RANDOM_CONDITION
getGroup
Parameters
name: string
group name
Returns ICRender.Group
Block group by it's name, if no group with specified name exist, this function creates a new one.
getUnnamedGroup
Creates a new group with a unique name.
Returns ICRender.Group
Class used to define block models that depend on surrounding blocks. Some examples of such blocks are wires, pipes, block structure parts, etc.