Class: GridObject
Defined in: src/util/GridObject.ts:8
An object contains grids - two dimensional arrrys of lines
Extends
Constructors
Constructor
new GridObject(
size?,divisions?):GridObject
Defined in: src/util/GridObject.ts:13
Parameters
size?
number = 100
divisions?
number = 10
Returns
GridObject
Overrides
Properties
name
name:
string=''
Defined in: src/core/entities/Entity.ts:23
The name of the object. The default value is an empty string.
Inherited from
transform
transform:
Transform
Defined in: src/core/entities/Entity.ts:38
The Transform attached to this object.
Inherited from
renderNode
renderNode:
RenderNode
Defined in: src/core/entities/Entity.ts:43
Renderer components
Inherited from
entityChildren
entityChildren:
Entity[]
Defined in: src/core/entities/Entity.ts:48
An array containing sub objects of an object
Inherited from
components
components:
Map<any,IComponent>
Defined in: src/core/entities/Entity.ts:53
List of components attached to an object
Inherited from
prefabRef?
optionalprefabRef?:string
Defined in: src/core/entities/Object3D.ts:19
Inherited from
serializeTag?
optionalserializeTag?:SerializeTag
Defined in: src/core/entities/Object3D.ts:20
Inherited from
size
size:
number=100
Defined in: src/util/GridObject.ts:9
divisions
divisions:
number=10
Defined in: src/util/GridObject.ts:11
Accessors
instanceID
Get Signature
get instanceID():
string
Defined in: src/core/entities/Entity.ts:31
The unique identifier of the object.
Returns
string
Inherited from
dispose
Get Signature
get dispose():
boolean
Defined in: src/core/entities/Entity.ts:67
Returns
boolean
Inherited from
numChildren
Get Signature
get numChildren():
number
Defined in: src/core/entities/Entity.ts:113
Returns the number of child objects of an object
Returns
number
Inherited from
bound
Get Signature
get bound():
IBound
Defined in: src/core/entities/Entity.ts:274
Returns
IBound
Set Signature
set bound(
value):void
Defined in: src/core/entities/Entity.ts:279
Parameters
value
IBound
Returns
void
Inherited from
isScene3D
Get Signature
get isScene3D():
boolean
Defined in: src/core/entities/Object3D.ts:30
Returns
boolean
Inherited from
localPosition
Get Signature
get localPosition():
Vector3
Defined in: src/core/entities/Object3D.ts:272
Get the position of an object relative to its parent
Returns
Set Signature
set localPosition(
value):void
Defined in: src/core/entities/Object3D.ts:279
Set the position of an object relative to its parent
Parameters
value
Returns
void
Inherited from
localRotation
Get Signature
get localRotation():
Vector3
Defined in: src/core/entities/Object3D.ts:286
Get the rotation attribute of an object relative to its parent
Returns
Set Signature
set localRotation(
value):void
Defined in: src/core/entities/Object3D.ts:293
Set the rotation attribute of an object relative to its parent
Parameters
value
Returns
void
Inherited from
localScale
Get Signature
get localScale():
Vector3
Defined in: src/core/entities/Object3D.ts:300
Get the scaling attribute of an object relative to its parent
Returns
Set Signature
set localScale(
value):void
Defined in: src/core/entities/Object3D.ts:307
Set the scaling attribute of an object relative to its parent
Parameters
value
Returns
void
Inherited from
localQuaternion
Get Signature
get localQuaternion():
Quaternion
Defined in: src/core/entities/Object3D.ts:314
Get the rotation attribute of an object relative to its parent, which is a quaternion
Returns
Set Signature
set localQuaternion(
value):void
Defined in: src/core/entities/Object3D.ts:321
Set the rotation attribute of an object relative to its parent, which is a quaternion
Parameters
value
Returns
void
Inherited from
parent
Get Signature
get parent():
Transform
Defined in: src/core/entities/Object3D.ts:336
Transform component of object parent
Returns
Inherited from
parentObject
Get Signature
get parentObject():
Object3D
Defined in: src/core/entities/Object3D.ts:344
parent object3D
Returns
Inherited from
x
Get Signature
get x():
number
Defined in: src/core/entities/Object3D.ts:360
Get the x coordinate relative to the local coordinates of the parent container.
Returns
number
Set Signature
set x(
value):void
Defined in: src/core/entities/Object3D.ts:352
Set the x coordinate relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
y
Get Signature
get y():
number
Defined in: src/core/entities/Object3D.ts:375
Get the y coordinate relative to the local coordinates of the parent container.
Returns
number
Set Signature
set y(
value):void
Defined in: src/core/entities/Object3D.ts:367
Set the y coordinate relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
z
Get Signature
get z():
number
Defined in: src/core/entities/Object3D.ts:389
Get the z coordinate relative to the local coordinates of the parent container.
Returns
number
Set Signature
set z(
value):void
Defined in: src/core/entities/Object3D.ts:382
Set the z coordinate relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
scaleX
Get Signature
get scaleX():
number
Defined in: src/core/entities/Object3D.ts:404
Get the x scale relative to the local coordinates of the parent container.
Returns
number
Set Signature
set scaleX(
value):void
Defined in: src/core/entities/Object3D.ts:396
Set the x scale relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
scaleY
Get Signature
get scaleY():
number
Defined in: src/core/entities/Object3D.ts:420
Get the y scale relative to the local coordinates of the parent container.
Returns
number
Set Signature
set scaleY(
value):void
Defined in: src/core/entities/Object3D.ts:412
Set the y scale relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
scaleZ
Get Signature
get scaleZ():
number
Defined in: src/core/entities/Object3D.ts:436
Get the z scale relative to the local coordinates of the parent container.
Returns
number
Set Signature
set scaleZ(
value):void
Defined in: src/core/entities/Object3D.ts:428
Set the z scale relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
rotationX
Get Signature
get rotationX():
number
Defined in: src/core/entities/Object3D.ts:452
Get the x rotation relative to the local coordinates of the parent container.
Returns
number
Set Signature
set rotationX(
value):void
Defined in: src/core/entities/Object3D.ts:444
Set the x rotation relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
rotationY
Get Signature
get rotationY():
number
Defined in: src/core/entities/Object3D.ts:468
Get the y rotation relative to the local coordinates of the parent container.
Returns
number
Set Signature
set rotationY(
value):void
Defined in: src/core/entities/Object3D.ts:460
Set the y rotation relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
rotationZ
Get Signature
get rotationZ():
number
Defined in: src/core/entities/Object3D.ts:484
Set the z rotation relative to the local coordinates of the parent container.
Returns
number
Set Signature
set rotationZ(
value):void
Defined in: src/core/entities/Object3D.ts:476
Set the z rotation relative to the local coordinates of the parent container.
Parameters
value
number
Returns
void
Inherited from
Methods
getObjectByName()
getObjectByName(
name):Entity
Defined in: src/core/entities/Entity.ts:78
Starting from the object itself, search for the object and its children, and return the first child object with a matching name. For most objects, the name is an empty string by default. You must manually set it to use this method.
Parameters
name
string
input name
Returns
result Entity
Inherited from
addChild()
addChild(
child):Entity
Defined in: src/core/entities/Entity.ts:124
Add an object as a child of this object. You can add any number of objects. Any current parent object on the object passed here will be deleted, as an object can only have at most one parent object.
Parameters
child
target child entity
Returns
Inherited from
removeChild()
removeChild(
child):void
Defined in: src/core/entities/Entity.ts:149
Remove the child objects of the object. You can remove any number of objects.
Parameters
child
Removed objects
Returns
void
Inherited from
removeAllChild()
removeAllChild():
void
Defined in: src/core/entities/Entity.ts:165
Remove all children of the current object
Returns
void
Inherited from
removeSelf()
removeSelf():
this
Defined in: src/core/entities/Entity.ts:176
Remove the current node from the parent
Returns
this
this
Inherited from
removeChildByIndex()
removeChildByIndex(
index):void
Defined in: src/core/entities/Entity.ts:186
Search for child nodes of objects and remove child objects with matching indexes.
Parameters
index
number
assign index
Returns
void
Inherited from
hasChild()
hasChild(
child):boolean
Defined in: src/core/entities/Entity.ts:200
Does the current object contain a certain object
Parameters
child
certain object
Returns
boolean
boolean
Inherited from
removeFromParent()
removeFromParent():
this
Defined in: src/core/entities/Entity.ts:210
Remove the current node from the parent
Returns
this
this
Inherited from
getChildByIndex()
getChildByIndex(
index):Entity
Defined in: src/core/entities/Entity.ts:224
Search for object children and return the first child object with a matching index.
Parameters
index
number
matching index
Returns
child entity
Inherited from
getChildByName()
getChildByName(
name,loopChild?):any
Defined in: src/core/entities/Entity.ts:239
Search for object children and return a child object with a matching name.
Parameters
name
string
matching name
loopChild?
boolean = true
Whether to traverse the children of the child object. The default value is true
Returns
any
result
Inherited from
noticeComponents()
noticeComponents(
key,data):void
Defined in: src/core/entities/Entity.ts:325
Parameters
key
keyof IComponent
data
any
Returns
void
Inherited from
forChild()
forChild(
call):void
Defined in: src/core/entities/Object3D.ts:41
Traverse all sub objects starting from the object itself. If there are still sub objects in the sub object, recursively traverse.
Parameters
call
Function
Returns
void
Inherited from
addComponent()
addComponent<
T>(c,param?):T
Defined in: src/core/entities/Object3D.ts:55
Create a new component and add it to the object, and return an instance of the component. If a component of this type already exists, it will not be added and will return null.
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
class of component
param?
any
Returns
T
result component
Inherited from
getOrAddComponent()
getOrAddComponent<
T>(c):T
Defined in: src/core/entities/Object3D.ts:76
Returns an instance of a component object of the specified type. If there are no components of that type, a new component is created and added to the object.
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
class of component
Returns
T
result component
Inherited from
removeComponent()
removeComponent<
T>(c):void
Defined in: src/core/entities/Object3D.ts:89
Remove components of the specified type
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
class of component
Returns
void
Inherited from
hasComponent()
hasComponent<
T>(c):boolean
Defined in: src/core/entities/Object3D.ts:106
Is there a component of the specified type
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
type of component
Returns
boolean
boolean
Inherited from
getComponent()
getComponent<
T>(c):T
Defined in: src/core/entities/Object3D.ts:116
Returns a component of the specified type.
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
class of component
Returns
T
result component
Inherited from
getComponentFromParent()
getComponentFromParent<
T>(c):T
Defined in: src/core/entities/Object3D.ts:128
Returns a component object of the specified type from the parent node. If there are no components of that type, calls the parent object lookup of the parent object
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
class of component
Returns
T
reulst component
Inherited from
Object3D.getComponentFromParent
getComponentsInChild()
getComponentsInChild<
T>(c):T[]
Defined in: src/core/entities/Object3D.ts:148
Returns an array of component objects of the specified type. If there are no components of that type, search in the list of self body class objects
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
class of component
Returns
T[]
result components
Inherited from
getComponents()
getComponents<
T>(c,outList?,includeInactive?):T[]
Defined in: src/core/entities/Object3D.ts:171
Returns all components of the specified type contained in the current object and its children. If there are children in the child object, recursively search.
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
class of component
outList?
T[]
result component list
includeInactive?
boolean
Whether to include invisible objects, default to false
Returns
T[]
Inherited from
getComponentsExt()
getComponentsExt<
T>(c,ret?,includeInactive?):T[]
Defined in: src/core/entities/Object3D.ts:196
Quickly obtain components and no longer access child nodes after obtaining them at a certain node
Type Parameters
T
T extends IComponent
Parameters
c
Ctor<T>
class of component
ret?
T[]
List of incoming T
includeInactive?
boolean
Whether to include invisible objects, default to false
Returns
T[]
{T}
Memberof
Object3D
Inherited from
getComponentsByProperty()
getComponentsByProperty<
T>(key,value,findedAndBreak?,ret?,includeInactive?):T[]
Defined in: src/core/entities/Object3D.ts:211
Type Parameters
T
T extends IComponent
Parameters
key
string
value
any
findedAndBreak?
boolean = true
ret?
T[]
includeInactive?
boolean
Returns
T[]
Inherited from
Object3D.getComponentsByProperty
clone()
clone():
Object3D
Defined in: src/core/entities/Object3D.ts:238
clone a Object3D
Returns
Inherited from
notifyChange()
notifyChange():
void
Defined in: src/core/entities/Object3D.ts:328
Notify transformation attribute updates
Returns
void
Inherited from
traverse()
traverse(
callback):void
Defined in: src/core/entities/Object3D.ts:505
Recursive child nodes and execute specified function
Parameters
callback
(child) => void
specified function
Returns
void
Inherited from
destroy()
destroy(
force?):void
Defined in: src/core/entities/Object3D.ts:520
Release self
Parameters
force?
boolean
Returns
void
Inherited from
dispatchEvent()
dispatchEvent(
event):void
Defined in: src/event/CEventDispatcher.ts:24
Dispatch an event to all registered objects with a specific type of listener.
Parameters
event
Returns
void
Inherited from
addEventListener()
addEventListener(
type,callback,thisObject,param?,priority?):number
Defined in: src/event/CEventDispatcher.ts:78
register an event listener to event distancher.
Parameters
type
string | number
{string} event type.
callback
Function
{Function} The callback function that handles events. This function must accept an Event3D object as its unique parameter and cannot return any result. for example: function(evt:Event3D):void.
thisObject
any
{any} Current registration object, it'll call callback function.
param?
any = null
{any} the data binded to registered event, the default value is null.
priority?
number = 0
{number} The priority of callback function execution, with a larger set value having priority to call
Returns
number
Returns register event id
Inherited from
removeEventListener()
removeEventListener(
type,callback,thisObject):void
Defined in: src/event/CEventDispatcher.ts:112
Remove Event Listening
Parameters
type
string | number
{string} event type
callback
Function
{Function} callback function of event register
thisObject
any
{any} The current registered object.
Returns
void
Inherited from
removeEventListenerAt()
removeEventListenerAt(
id):boolean
Defined in: src/event/CEventDispatcher.ts:132
Remove an event Listening with id
Parameters
id
number
Returns
boolean
Inherited from
Object3D.removeEventListenerAt
removeAllEventListener()
removeAllEventListener(
eventType?):void
Defined in: src/event/CEventDispatcher.ts:152
Specify a event type to remove all related event listeners eventType event type, set null to remove all event listeners
Parameters
eventType?
string | number
Returns
void
Inherited from
Object3D.removeAllEventListener
containEventListener()
containEventListener(
type):boolean
Defined in: src/event/CEventDispatcher.ts:184
whether the target presence of a listener with event type.
Parameters
type
string
{string} event type.
Returns
boolean
Returns a boolean.
Inherited from
hasEventListener()
hasEventListener(
type,callback?,thisObject?):boolean
Defined in: src/event/CEventDispatcher.ts:197
whether the target presence of a listener with event type. it associate more registration parameters.
Parameters
type
string | number
{string} event name.
callback?
Function = null
{Function} callback function of event register.
thisObject?
any = null
{any} The registered object.
Returns
boolean
Returns a boolean.

