MCPcopy
hub / github.com/mrdoob/three.js / constructor

Method constructor

src/core/Object3D.js:69–390  ·  view source on GitHub ↗

* Constructs a new 3D object.

()

Source from the content-addressed store, hash-verified

67 * Constructs a new 3D object.
68 */
69 constructor() {
70
71 super();
72
73 /**
74 * This flag can be used for type testing.
75 *
76 * @type {boolean}
77 * @readonly
78 * @default true
79 */
80 this.isObject3D = true;
81
82 /**
83 * The ID of the 3D object.
84 *
85 * @name Object3D#id
86 * @type {number}
87 * @readonly
88 */
89 Object.defineProperty( this, 'id', { value: _object3DId ++ } );
90
91 /**
92 * The UUID of the 3D object.
93 *
94 * @type {string}
95 * @readonly
96 */
97 this.uuid = generateUUID();
98
99 /**
100 * The name of the 3D object.
101 *
102 * @type {string}
103 */
104 this.name = '';
105
106 /**
107 * The type property is used for detecting the object type
108 * in context of serialization/deserialization.
109 *
110 * @type {string}
111 * @readonly
112 */
113 this.type = 'Object3D';
114
115 /**
116 * A reference to the parent object.
117 *
118 * @type {?Object3D}
119 * @default null
120 */
121 this.parent = null;
122
123 /**
124 * An array holding the child 3D objects of this instance.
125 *
126 * @type {Array<Object3D>}

Callers

nothing calls this directly

Calls 5

_onChangeMethod · 0.95
_onChangeMethod · 0.95
generateUUIDFunction · 0.90
definePropertyMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected