t3d. PropertyMap

PropertyMap is a helper class for storing properties on objects. Instead of using a Map, we store the property map directly on the object itself, which provides better lookup performance. This is generally used to store the gpu resources corresponding to objects.

Constructor

new PropertyMap(prefix)

Create a new PropertyMap.
Parameters:
NameTypeDescription
prefixStringThe prefix of the properties name.

Methods

delete(object)

Delete the properties of the object.
Parameters:
NameTypeDescription
objectObjectThe object to delete properties.

get(object) → {Object}

Get the properties of the object. If the object does not have properties, create a new one.
Parameters:
NameTypeDescription
objectObjectThe object to get properties.
Returns:
- The properties of the object.
Type: 
Object

size() → {Number}

Get the number of objects that have properties.
Returns:
- The number of objects that have properties.
Type: 
Number