block

From Teverse


Properties

velocity

Type: vector3

rotation

Type: quaternion

emissiveColour

Type: colour

linearFactor

Type: vector3
Restricts the linear movement in the physics engine. A value of (1,1,1) allows the object to move in all directions whereas (0,1,0) means the object can only move up and down on the y axis.

doNotSerialise

Type: boolean
The built in game serialiser will not serialise objects with this set as true.

friction

Type: number

mesh

Type: string
The file that teverse will use to load a 3d model, using resource locators.

renderQueue

Type: number

restitution

Type: number

spinningFriction

Type: number

workshopLocked

Type: boolean
Solely used in workshop

size

Type: vector3

meshScale [readonly]

Type: vector3
This is the value Teverse has had to scale the loaded mesh down in order to fit it in a 1x1x1 bounding box

roughness

Type: number

linearDamping

Type: number

position

Type: vector3
Location of the object in 3D space

networkedId [readonly]

Type: number

physics

Type: boolean
When true, things like raycasting may not work correctly for this object

angularFactor

Type: vector3

metalness

Type: number

static

Type: boolean
When true, this object will not move as it will become unaffected by forces including gravity.

rollingFriction

Type: number

className [readonly]

Type: string

colour

Type: colour

castsShadows

Type: boolean

angularDamping

Type: number

wireframe

Type: boolean

angularVelocity

Type: vector3

opacity

Type: number
A value of 1 indicates this object is not transparent.

Inherited from baseClass:

name

Type: string
A none unique identifier

className [readonly]

Type: string
The name of the object's class

Methods

applyImpulseAtPosition

nil block:applyImpulseAtPosition(vector3 impulsevector3)
Applies an impulse force at a relative position to this object

applyImpulse

nil block:applyImpulse(vector3 impulse)
Applies an impulse force to this object

applyForce

nil block:applyForce(vector3 force)
Applies a force to this object

applyTorque

nil block:applyTorque(vector3 torque)
Applies a force to this object

applyForceAtPosition

nil block:applyForceAtPosition(vector3 positionvector3)
Applies a force at a relative position to this object

lookAt

nil block:lookAt(vector3 position)
Changes the objects rotation so that it is looking towards the provided position.

applyTorqueImpulse

nil block:applyTorqueImpulse(vector3 torqueImpulse)
Applies a force to this object

Inherited from baseClass:

getDescendants

table block:getDescendants()
Returns a table of all descended objects

isContainer

boolean block:isContainer()

isA

boolean block:isA(string className)
Returns true if this object is derived from the className given.

destroy

nil block:destroy()
Locks the object before removing it from the hierarchy. Children will also be destroyed.

getFullName

string block:getFullName()
Returns a string including ancestor names

constructor

nil block:constructor()

destroyAllChildren

nil block:destroyAllChildren()
Invokes the destroy method on each child of this instance.

hasChild

boolean block:hasChild(string name)
Returns true if this object has a child with the name given

isDescendantOf

boolean block:isDescendantOf(baseClass ancestor)
Returns true if this object is a descendant of the ancestor object given

describe

nil block:describe()

clone

variant block:clone()
Creates and returns a copy of this object

Events

mouseLeftPressed

eventListener block:mouseLeftPressed(function())

collisionStarted

eventListener block:collisionStarted(function())

mouseLeftReleased

eventListener block:mouseLeftReleased(function())

mouseRightPressed

eventListener block:mouseRightPressed(function())

mouseRightReleased

eventListener block:mouseRightReleased(function())

collisionEnded

eventListener block:collisionEnded(function())

mouseMiddleReleased

eventListener block:mouseMiddleReleased(function())

mouseMiddlePressed

eventListener block:mouseMiddlePressed(function())

Inherited from baseClass:

changed

eventListener block:changed(function(string propertyName, variant newValuevariant))
Fired when a property changes

childAdded

eventListener block:childAdded(function(baseClass child))
Fired when a child is added

childRemoved

eventListener block:childRemoved(function(baseClass child))
Fired when a child is removed

destroying

eventListener block:destroying(function())
Fired just before an object is destroyed.

Sub classes

Category derivedFromblock not found