| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Object3D - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → </p>
- <h1 translate="no">Object3D</h1>
- <section>
- <header>
- <div class="class-description"><p>This is the base class for most objects in three.js and provides a set of
- properties and methods for manipulating objects in 3D space.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="Object3D" translate="no">new <a href="#Object3D">Object3D</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new 3D object.</p>
- </div>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="animations" translate="no">.<a href="#animations">animations</a><span class="type-signature"> : Array.<<a href="AnimationClip.html">AnimationClip</a>></span> </h3>
- <div class="description">
- <p>An array holding the animation clips of the 3D object.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="castShadow" translate="no">.<a href="#castShadow">castShadow</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>When set to <code>true</code>, the 3D object gets rendered into shadow maps.</p>
- <p>Default is <code>false</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="children" translate="no">.<a href="#children">children</a><span class="type-signature"> : Array.<<a href="Object3D.html">Object3D</a>></span> </h3>
- <div class="description">
- <p>An array holding the child 3D objects of this instance.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="customDepthMaterial" translate="no">.<a href="#customDepthMaterial">customDepthMaterial</a><span class="type-signature"> : <a href="Material.html">Material</a> | undefined</span> </h3>
- <div class="description">
- <p>Custom depth material to be used when rendering to the depth map. Can only be used
- in context of meshes. When shadow-casting with a <a href="DirectionalLight.html">DirectionalLight</a> or <a href="SpotLight.html">SpotLight</a>,
- if you are modifying vertex positions in the vertex shader you must specify a custom depth
- material for proper shadows.</p>
- <p>Only relevant in context of <a href="WebGLRenderer.html">WebGLRenderer</a>.</p>
- <p>Default is <code>undefined</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="customDistanceMaterial" translate="no">.<a href="#customDistanceMaterial">customDistanceMaterial</a><span class="type-signature"> : <a href="Material.html">Material</a> | undefined</span> </h3>
- <div class="description">
- <p>Same as <a href="Object3D.html#customDepthMaterial">Object3D#customDepthMaterial</a>, but used with <a href="PointLight.html">PointLight</a>.</p>
- <p>Only relevant in context of <a href="WebGLRenderer.html">WebGLRenderer</a>.</p>
- <p>Default is <code>undefined</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="frustumCulled" translate="no">.<a href="#frustumCulled">frustumCulled</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>When set to <code>true</code>, the 3D object is honored by view frustum culling.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="id" translate="no">.<a href="#id">id</a><span class="type-signature"> : number</span> <span class="type-signature">(readonly) </span></h3>
- <div class="description">
- <p>The ID of the 3D object.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="isObject3D" translate="no">.<a href="#isObject3D">isObject3D</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
- <div class="description">
- <p>This flag can be used for type testing.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="layers" translate="no">.<a href="#layers">layers</a><span class="type-signature"> : <a href="Layers.html">Layers</a></span> </h3>
- <div class="description">
- <p>The layer membership of the 3D object. The 3D object is only visible if it has
- at least one layer in common with the camera in use. This property can also be
- used to filter out unwanted objects in ray-intersection tests when using <a href="Raycaster.html">Raycaster</a>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="matrix" translate="no">.<a href="#matrix">matrix</a><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="description">
- <p>Represents the object's transformation matrix in local space.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="matrixAutoUpdate" translate="no">.<a href="#matrixAutoUpdate">matrixAutoUpdate</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>When set to <code>true</code>, the engine automatically computes the local matrix from position,
- rotation and scale every frame.</p>
- <p>The default values for all 3D objects is defined by <code>Object3D.DEFAULT_MATRIX_AUTO_UPDATE</code>.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="matrixWorld" translate="no">.<a href="#matrixWorld">matrixWorld</a><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="description">
- <p>Represents the object's transformation matrix in world space.
- If the 3D object has no parent, then it's identical to the local transformation matrix</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="matrixWorldAutoUpdate" translate="no">.<a href="#matrixWorldAutoUpdate">matrixWorldAutoUpdate</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>When set to <code>true</code>, the engine automatically computes the world matrix from the current local
- matrix and the object's transformation hierarchy.</p>
- <p>The default values for all 3D objects is defined by <code>Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE</code>.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="matrixWorldNeedsUpdate" translate="no">.<a href="#matrixWorldNeedsUpdate">matrixWorldNeedsUpdate</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>When set to <code>true</code>, it calculates the world matrix in that frame and resets this property
- to <code>false</code>.</p>
- <p>Default is <code>false</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="modelViewMatrix" translate="no">.<a href="#modelViewMatrix">modelViewMatrix</a><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="description">
- <p>Represents the object's model-view matrix.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
- <div class="description">
- <p>The name of the 3D object.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="normalMatrix" translate="no">.<a href="#normalMatrix">normalMatrix</a><span class="type-signature"> : <a href="Matrix3.html">Matrix3</a></span> </h3>
- <div class="description">
- <p>Represents the object's normal matrix.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="parent" translate="no">.<a href="#parent">parent</a><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="description">
- <p>A reference to the parent object.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="position" translate="no">.<a href="#position">position</a><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="description">
- <p>Represents the object's local position.</p>
- <p>Default is <code>(0,0,0)</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="quaternion" translate="no">.<a href="#quaternion">quaternion</a><span class="type-signature"> : <a href="Quaternion.html">Quaternion</a></span> </h3>
- <div class="description">
- <p>Represents the object's local rotation as Quaternions.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="receiveShadow" translate="no">.<a href="#receiveShadow">receiveShadow</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>When set to <code>true</code>, the 3D object is affected by shadows in the scene.</p>
- <p>Default is <code>false</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="renderOrder" translate="no">.<a href="#renderOrder">renderOrder</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>This value allows the default rendering order of scene graph objects to be
- overridden although opaque and transparent objects remain sorted independently.
- When this property is set for an instance of <a href="Group.html">Group</a>,all descendants
- objects will be sorted and rendered together. Sorting is from lowest to highest
- render order.</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="rotation" translate="no">.<a href="#rotation">rotation</a><span class="type-signature"> : <a href="Euler.html">Euler</a></span> </h3>
- <div class="description">
- <p>Represents the object's local rotation as Euler angles, in radians.</p>
- <p>Default is <code>(0,0,0)</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="scale" translate="no">.<a href="#scale">scale</a><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="description">
- <p>Represents the object's local scale.</p>
- <p>Default is <code>(1,1,1)</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="type" translate="no">.<a href="#type">type</a><span class="type-signature"> : string</span> <span class="type-signature">(readonly) </span></h3>
- <div class="description">
- <p>The type property is used for detecting the object type
- in context of serialization/deserialization.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="up" translate="no">.<a href="#up">up</a><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="description">
- <p>Defines the <code>up</code> direction of the 3D object which influences
- the orientation via methods like <a href="Object3D.html#lookAt">Object3D#lookAt</a>.</p>
- <p>The default values for all 3D objects is defined by <code>Object3D.DEFAULT_UP</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="userData" translate="no">.<a href="#userData">userData</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>An object that can be used to store custom data about the 3D object. It
- should not hold references to functions as these will not be cloned.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="uuid" translate="no">.<a href="#uuid">uuid</a><span class="type-signature"> : string</span> <span class="type-signature">(readonly) </span></h3>
- <div class="description">
- <p>The UUID of the 3D object.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="visible" translate="no">.<a href="#visible">visible</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>When set to <code>true</code>, the 3D object gets rendered.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id=".DEFAULT_MATRIX_AUTO_UPDATE" translate="no">.<a href="#.DEFAULT_MATRIX_AUTO_UPDATE">DEFAULT_MATRIX_AUTO_UPDATE</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>The default setting for <a href="Object3D.html#matrixAutoUpdate">Object3D#matrixAutoUpdate</a> for
- newly created 3D objects.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id=".DEFAULT_MATRIX_WORLD_AUTO_UPDATE" translate="no">.<a href="#.DEFAULT_MATRIX_WORLD_AUTO_UPDATE">DEFAULT_MATRIX_WORLD_AUTO_UPDATE</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>The default setting for <a href="Object3D.html#matrixWorldAutoUpdate">Object3D#matrixWorldAutoUpdate</a> for
- newly created 3D objects.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id=".DEFAULT_UP" translate="no">.<a href="#.DEFAULT_UP">DEFAULT_UP</a><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="description">
- <p>The default up direction for objects, also used as the default
- position for <a href="DirectionalLight.html">DirectionalLight</a> and <a href="HemisphereLight.html">HemisphereLight</a>.</p>
- <p>Default is <code>(0,1,0)</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="add" translate="no">.<a href="#add">add</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds the given 3D object as a child to this 3D object. An arbitrary number of
- objects may be added. Any current parent on an object passed in here will be
- removed, since an object can have at most one parent.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>object</strong>
- </td>
- <td class="description last">
- <p>The 3D object to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <h5>Fires:</h5>
- <ul>
- <li><a href="Object3D.html#event:added">Object3D#event:added</a></li>
- <li><a href="Object3D.html#event:childadded">Object3D#event:childadded</a></li>
- </ul>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="applyMatrix4" translate="no">.<a href="#applyMatrix4">applyMatrix4</a><span class="signature">( matrix : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Applies the given transformation matrix to the object and updates the object's position,
- rotation and scale.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>matrix</strong>
- </td>
- <td class="description last">
- <p>The transformation matrix.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="applyQuaternion" translate="no">.<a href="#applyQuaternion">applyQuaternion</a><span class="signature">( q : <span class="param-type"><a href="Quaternion.html">Quaternion</a></span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Applies a rotation represented by given the quaternion to the 3D object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>q</strong>
- </td>
- <td class="description last">
- <p>The quaternion.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="attach" translate="no">.<a href="#attach">attach</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds the given 3D object as a child of this 3D object, while maintaining the object's world
- transform. This method does not support scene graphs having non-uniformly-scaled nodes(s).</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>object</strong>
- </td>
- <td class="description last">
- <p>The 3D object to attach.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <h5>Fires:</h5>
- <ul>
- <li><a href="Object3D.html#event:added">Object3D#event:added</a></li>
- <li><a href="Object3D.html#event:childadded">Object3D#event:childadded</a></li>
- </ul>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="clear" translate="no">.<a href="#clear">clear</a><span class="signature">()</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Removes all child objects.</p>
- </div>
- <h5>Fires:</h5>
- <ul>
- <li><a href="Object3D.html#event:removed">Object3D#event:removed</a></li>
- <li><a href="Object3D.html#event:childremoved">Object3D#event:childremoved</a></li>
- </ul>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="clone" translate="no">.<a href="#clone">clone</a><span class="signature">( recursive : <span class="param-type">boolean</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a new 3D object with copied values from this instance.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>recursive</strong>
- </td>
- <td class="description last">
- <p>When set to <code>true</code>, descendants of the 3D object are also cloned.</p>
- <p>Default is <code>true</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="copy" translate="no">.<a href="#copy">copy</a><span class="signature">( source : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, recursive : <span class="param-type">boolean</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Copies the values of the given 3D object to this instance.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>source</strong>
- </td>
- <td class="description last">
- <p>The 3D object to copy.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>recursive</strong>
- </td>
- <td class="description last">
- <p>When set to <code>true</code>, descendants of the 3D object are cloned.</p>
- <p>Default is <code>true</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getObjectById" translate="no">.<a href="#getObjectById">getObjectById</a><span class="signature">( id : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a> | undefined</span> </h3>
- <div class="method">
- <div class="description">
- <p>Searches through the 3D object and its children, starting with the 3D object
- itself, and returns the first with a matching ID.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>id</strong>
- </td>
- <td class="description last">
- <p>The id.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The found 3D object. Returns <code>undefined</code> if no 3D object has been found.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getObjectByName" translate="no">.<a href="#getObjectByName">getObjectByName</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a> | undefined</span> </h3>
- <div class="method">
- <div class="description">
- <p>Searches through the 3D object and its children, starting with the 3D object
- itself, and returns the first with a matching name.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The name.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The found 3D object. Returns <code>undefined</code> if no 3D object has been found.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getObjectByProperty" translate="no">.<a href="#getObjectByProperty">getObjectByProperty</a><span class="signature">( name : <span class="param-type">string</span>, value : <span class="param-type"><a href="global.html#any">any</a></span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a> | undefined</span> </h3>
- <div class="method">
- <div class="description">
- <p>Searches through the 3D object and its children, starting with the 3D object
- itself, and returns the first with a matching property value.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The name of the property.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>value</strong>
- </td>
- <td class="description last">
- <p>The value.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The found 3D object. Returns <code>undefined</code> if no 3D object has been found.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getObjectsByProperty" translate="no">.<a href="#getObjectsByProperty">getObjectsByProperty</a><span class="signature">( name : <span class="param-type">string</span>, value : <span class="param-type"><a href="global.html#any">any</a></span>, result : <span class="param-type">Array.<<a href="Object3D.html">Object3D</a>></span> )</span><span class="type-signature"> : Array.<<a href="Object3D.html">Object3D</a>></span> </h3>
- <div class="method">
- <div class="description">
- <p>Searches through the 3D object and its children, starting with the 3D object
- itself, and returns all 3D objects with a matching property value.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>name</strong>
- </td>
- <td class="description last">
- <p>The name of the property.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>value</strong>
- </td>
- <td class="description last">
- <p>The value.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>result</strong>
- </td>
- <td class="description last">
- <p>The method stores the result in this array.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The found 3D objects.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getWorldDirection" translate="no">.<a href="#getWorldDirection">getWorldDirection</a><span class="signature">( target : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a vector representing the ("look") direction of the 3D object in world space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>target</strong>
- </td>
- <td class="description last">
- <p>The target vector the result is stored to.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The 3D object's direction in world space.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getWorldPosition" translate="no">.<a href="#getWorldPosition">getWorldPosition</a><span class="signature">( target : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a vector representing the position of the 3D object in world space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>target</strong>
- </td>
- <td class="description last">
- <p>The target vector the result is stored to.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The 3D object's position in world space.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getWorldQuaternion" translate="no">.<a href="#getWorldQuaternion">getWorldQuaternion</a><span class="signature">( target : <span class="param-type"><a href="Quaternion.html">Quaternion</a></span> )</span><span class="type-signature"> : <a href="Quaternion.html">Quaternion</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a Quaternion representing the position of the 3D object in world space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>target</strong>
- </td>
- <td class="description last">
- <p>The target Quaternion the result is stored to.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The 3D object's rotation in world space.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getWorldScale" translate="no">.<a href="#getWorldScale">getWorldScale</a><span class="signature">( target : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a vector representing the scale of the 3D object in world space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>target</strong>
- </td>
- <td class="description last">
- <p>The target vector the result is stored to.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The 3D object's scale in world space.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="localToWorld" translate="no">.<a href="#localToWorld">localToWorld</a><span class="signature">( vector : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Converts the given vector from this 3D object's local space to world space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>vector</strong>
- </td>
- <td class="description last">
- <p>The vector to convert.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The converted vector.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="lookAt" translate="no">.<a href="#lookAt">lookAt</a><span class="signature">( x : <span class="param-type">number | <a href="Vector3.html">Vector3</a></span>, y : <span class="param-type">number</span>, z : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Rotates the object to face a point in world space.</p>
- <p>This method does not support objects having non-uniformly-scaled parent(s).</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>x</strong>
- </td>
- <td class="description last">
- <p>The x coordinate in world space. Alternatively, a vector representing a position in world space</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>y</strong>
- </td>
- <td class="description last">
- <p>The y coordinate in world space.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>z</strong>
- </td>
- <td class="description last">
- <p>The z coordinate in world space.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="onAfterRender" translate="no">.<a href="#onAfterRender">onAfterRender</a><span class="signature">( renderer : <span class="param-type"><a href="Renderer.html">Renderer</a> | <a href="WebGLRenderer.html">WebGLRenderer</a></span>, object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span>, geometry : <span class="param-type"><a href="BufferGeometry.html">BufferGeometry</a></span>, material : <span class="param-type"><a href="Material.html">Material</a></span>, group : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>A callback that is executed immediately after a 3D object is rendered.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>renderer</strong>
- </td>
- <td class="description last">
- <p>The renderer.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>object</strong>
- </td>
- <td class="description last">
- <p>The 3D object.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>camera</strong>
- </td>
- <td class="description last">
- <p>The camera that is used to render the scene.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>geometry</strong>
- </td>
- <td class="description last">
- <p>The 3D object's geometry.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>material</strong>
- </td>
- <td class="description last">
- <p>The 3D object's material.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>group</strong>
- </td>
- <td class="description last">
- <p>The geometry group data.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="onAfterShadow" translate="no">.<a href="#onAfterShadow">onAfterShadow</a><span class="signature">( renderer : <span class="param-type"><a href="Renderer.html">Renderer</a> | <a href="WebGLRenderer.html">WebGLRenderer</a></span>, object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span>, shadowCamera : <span class="param-type"><a href="Camera.html">Camera</a></span>, geometry : <span class="param-type"><a href="BufferGeometry.html">BufferGeometry</a></span>, depthMaterial : <span class="param-type"><a href="Material.html">Material</a></span>, group : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>A callback that is executed immediately after a 3D object is rendered to a shadow map.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>renderer</strong>
- </td>
- <td class="description last">
- <p>The renderer.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>object</strong>
- </td>
- <td class="description last">
- <p>The 3D object.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>camera</strong>
- </td>
- <td class="description last">
- <p>The camera that is used to render the scene.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shadowCamera</strong>
- </td>
- <td class="description last">
- <p>The shadow camera.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>geometry</strong>
- </td>
- <td class="description last">
- <p>The 3D object's geometry.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>depthMaterial</strong>
- </td>
- <td class="description last">
- <p>The depth material.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>group</strong>
- </td>
- <td class="description last">
- <p>The geometry group data.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="onBeforeRender" translate="no">.<a href="#onBeforeRender">onBeforeRender</a><span class="signature">( renderer : <span class="param-type"><a href="Renderer.html">Renderer</a> | <a href="WebGLRenderer.html">WebGLRenderer</a></span>, object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span>, geometry : <span class="param-type"><a href="BufferGeometry.html">BufferGeometry</a></span>, material : <span class="param-type"><a href="Material.html">Material</a></span>, group : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>A callback that is executed immediately before a 3D object is rendered.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>renderer</strong>
- </td>
- <td class="description last">
- <p>The renderer.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>object</strong>
- </td>
- <td class="description last">
- <p>The 3D object.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>camera</strong>
- </td>
- <td class="description last">
- <p>The camera that is used to render the scene.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>geometry</strong>
- </td>
- <td class="description last">
- <p>The 3D object's geometry.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>material</strong>
- </td>
- <td class="description last">
- <p>The 3D object's material.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>group</strong>
- </td>
- <td class="description last">
- <p>The geometry group data.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="onBeforeShadow" translate="no">.<a href="#onBeforeShadow">onBeforeShadow</a><span class="signature">( renderer : <span class="param-type"><a href="Renderer.html">Renderer</a> | <a href="WebGLRenderer.html">WebGLRenderer</a></span>, object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span>, shadowCamera : <span class="param-type"><a href="Camera.html">Camera</a></span>, geometry : <span class="param-type"><a href="BufferGeometry.html">BufferGeometry</a></span>, depthMaterial : <span class="param-type"><a href="Material.html">Material</a></span>, group : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>A callback that is executed immediately before a 3D object is rendered to a shadow map.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>renderer</strong>
- </td>
- <td class="description last">
- <p>The renderer.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>object</strong>
- </td>
- <td class="description last">
- <p>The 3D object.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>camera</strong>
- </td>
- <td class="description last">
- <p>The camera that is used to render the scene.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>shadowCamera</strong>
- </td>
- <td class="description last">
- <p>The shadow camera.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>geometry</strong>
- </td>
- <td class="description last">
- <p>The 3D object's geometry.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>depthMaterial</strong>
- </td>
- <td class="description last">
- <p>The depth material.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>group</strong>
- </td>
- <td class="description last">
- <p>The geometry group data.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="raycast" translate="no">.<a href="#raycast">raycast</a><span class="signature">( raycaster : <span class="param-type"><a href="Raycaster.html">Raycaster</a></span>, intersects : <span class="param-type">Array.<Object></span> )</span> <span class="type-signature">(abstract) </span></h3>
- <div class="method">
- <div class="description">
- <p>Abstract method to get intersections between a casted ray and this
- 3D object. Renderable 3D objects such as <a href="Mesh.html">Mesh</a>, <a href="Line.html">Line</a> or <a href="Points.html">Points</a>
- implement this method in order to use raycasting.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>raycaster</strong>
- </td>
- <td class="description last">
- <p>The raycaster.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>intersects</strong>
- </td>
- <td class="description last">
- <p>An array holding the result of the method.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="remove" translate="no">.<a href="#remove">remove</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Removes the given 3D object as child from this 3D object.
- An arbitrary number of objects may be removed.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>object</strong>
- </td>
- <td class="description last">
- <p>The 3D object to remove.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <h5>Fires:</h5>
- <ul>
- <li><a href="Object3D.html#event:removed">Object3D#event:removed</a></li>
- <li><a href="Object3D.html#event:childremoved">Object3D#event:childremoved</a></li>
- </ul>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="removeFromParent" translate="no">.<a href="#removeFromParent">removeFromParent</a><span class="signature">()</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Removes this 3D object from its current parent.</p>
- </div>
- <h5>Fires:</h5>
- <ul>
- <li><a href="Object3D.html#event:removed">Object3D#event:removed</a></li>
- <li><a href="Object3D.html#event:childremoved">Object3D#event:childremoved</a></li>
- </ul>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="rotateOnAxis" translate="no">.<a href="#rotateOnAxis">rotateOnAxis</a><span class="signature">( axis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, angle : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Rotates the 3D object along an axis in local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>axis</strong>
- </td>
- <td class="description last">
- <p>The (normalized) axis vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>angle</strong>
- </td>
- <td class="description last">
- <p>The angle in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="rotateOnWorldAxis" translate="no">.<a href="#rotateOnWorldAxis">rotateOnWorldAxis</a><span class="signature">( axis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, angle : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Rotates the 3D object along an axis in world space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>axis</strong>
- </td>
- <td class="description last">
- <p>The (normalized) axis vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>angle</strong>
- </td>
- <td class="description last">
- <p>The angle in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="rotateX" translate="no">.<a href="#rotateX">rotateX</a><span class="signature">( angle : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Rotates the 3D object around its X axis in local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>angle</strong>
- </td>
- <td class="description last">
- <p>The angle in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="rotateY" translate="no">.<a href="#rotateY">rotateY</a><span class="signature">( angle : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Rotates the 3D object around its Y axis in local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>angle</strong>
- </td>
- <td class="description last">
- <p>The angle in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="rotateZ" translate="no">.<a href="#rotateZ">rotateZ</a><span class="signature">( angle : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Rotates the 3D object around its Z axis in local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>angle</strong>
- </td>
- <td class="description last">
- <p>The angle in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setRotationFromAxisAngle" translate="no">.<a href="#setRotationFromAxisAngle">setRotationFromAxisAngle</a><span class="signature">( axis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, angle : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the given rotation represented as an axis/angle couple to the 3D object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>axis</strong>
- </td>
- <td class="description last">
- <p>The (normalized) axis vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>angle</strong>
- </td>
- <td class="description last">
- <p>The angle in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setRotationFromEuler" translate="no">.<a href="#setRotationFromEuler">setRotationFromEuler</a><span class="signature">( euler : <span class="param-type"><a href="Euler.html">Euler</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the given rotation represented as Euler angles to the 3D object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>euler</strong>
- </td>
- <td class="description last">
- <p>The Euler angles.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setRotationFromMatrix" translate="no">.<a href="#setRotationFromMatrix">setRotationFromMatrix</a><span class="signature">( m : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the given rotation represented as rotation matrix to the 3D object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>m</strong>
- </td>
- <td class="description last">
- <p>Although a 4x4 matrix is expected, the upper 3x3 portion must be
- a pure rotation matrix (i.e, unscaled).</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setRotationFromQuaternion" translate="no">.<a href="#setRotationFromQuaternion">setRotationFromQuaternion</a><span class="signature">( q : <span class="param-type"><a href="Quaternion.html">Quaternion</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the given rotation represented as a Quaternion to the 3D object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>q</strong>
- </td>
- <td class="description last">
- <p>The Quaternion</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="toJSON" translate="no">.<a href="#toJSON">toJSON</a><span class="signature">( meta : <span class="param-type">Object | string</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Serializes the 3D object into JSON.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>meta</strong>
- </td>
- <td class="description last">
- <p>An optional value holding meta information about the serialization.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-see">See:</dt>
- <dd class="tag-see">
- <ul>
- <li><a href="ObjectLoader.html#parse">ObjectLoader#parse</a></li>
- </ul>
- </dd>
- </dl>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A JSON object representing the serialized 3D object.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="translateOnAxis" translate="no">.<a href="#translateOnAxis">translateOnAxis</a><span class="signature">( axis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, distance : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Translate the 3D object by a distance along the given axis in local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>axis</strong>
- </td>
- <td class="description last">
- <p>The (normalized) axis vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>distance</strong>
- </td>
- <td class="description last">
- <p>The distance in world units.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="translateX" translate="no">.<a href="#translateX">translateX</a><span class="signature">( distance : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Translate the 3D object by a distance along its X-axis in local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>distance</strong>
- </td>
- <td class="description last">
- <p>The distance in world units.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="translateY" translate="no">.<a href="#translateY">translateY</a><span class="signature">( distance : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Translate the 3D object by a distance along its Y-axis in local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>distance</strong>
- </td>
- <td class="description last">
- <p>The distance in world units.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="translateZ" translate="no">.<a href="#translateZ">translateZ</a><span class="signature">( distance : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Translate the 3D object by a distance along its Z-axis in local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>distance</strong>
- </td>
- <td class="description last">
- <p>The distance in world units.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="traverse" translate="no">.<a href="#traverse">traverse</a><span class="signature">( callback : <span class="param-type">function</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Executes the callback on this 3D object and all descendants.</p>
- <p>Note: Modifying the scene graph inside the callback is discouraged.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>callback</strong>
- </td>
- <td class="description last">
- <p>A callback function that allows to process the current 3D object.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="traverseAncestors" translate="no">.<a href="#traverseAncestors">traverseAncestors</a><span class="signature">( callback : <span class="param-type">function</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Like <a href="Object3D.html#traverse">Object3D#traverse</a>, but the callback will only be executed for all ancestors.</p>
- <p>Note: Modifying the scene graph inside the callback is discouraged.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>callback</strong>
- </td>
- <td class="description last">
- <p>A callback function that allows to process the current 3D object.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="traverseVisible" translate="no">.<a href="#traverseVisible">traverseVisible</a><span class="signature">( callback : <span class="param-type">function</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Like <a href="Object3D.html#traverse">Object3D#traverse</a>, but the callback will only be executed for visible 3D objects.
- Descendants of invisible 3D objects are not traversed.</p>
- <p>Note: Modifying the scene graph inside the callback is discouraged.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>callback</strong>
- </td>
- <td class="description last">
- <p>A callback function that allows to process the current 3D object.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="updateMatrix" translate="no">.<a href="#updateMatrix">updateMatrix</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Updates the transformation matrix in local space by computing it from the current
- position, rotation and scale values.</p>
- </div>
- </div>
- <h3 class="name name-method" id="updateMatrixWorld" translate="no">.<a href="#updateMatrixWorld">updateMatrixWorld</a><span class="signature">( force : <span class="param-type">boolean</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Updates the transformation matrix in world space of this 3D objects and its descendants.</p>
- <p>To ensure correct results, this method also recomputes the 3D object's transformation matrix in
- local space. The computation of the local and world matrix can be controlled with the
- <a href="Object3D.html#matrixAutoUpdate">Object3D#matrixAutoUpdate</a> and <a href="Object3D.html#matrixWorldAutoUpdate">Object3D#matrixWorldAutoUpdate</a> flags which are both
- <code>true</code> by default. Set these flags to <code>false</code> if you need more control over the update matrix process.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>force</strong>
- </td>
- <td class="description last">
- <p>When set to <code>true</code>, a recomputation of world matrices is forced even
- when <a href="Object3D.html#matrixWorldAutoUpdate">Object3D#matrixWorldAutoUpdate</a> is set to <code>false</code>.</p>
- <p>Default is <code>false</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="updateWorldMatrix" translate="no">.<a href="#updateWorldMatrix">updateWorldMatrix</a><span class="signature">( updateParents : <span class="param-type">boolean</span>, updateChildren : <span class="param-type">boolean</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>An alternative version of <a href="Object3D.html#updateMatrixWorld">Object3D#updateMatrixWorld</a> with more control over the
- update of ancestor and descendant nodes.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>updateParents</strong>
- </td>
- <td class="description last">
- <p>Whether ancestor nodes should be updated or not.</p>
- <p>Default is <code>false</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>updateChildren</strong>
- </td>
- <td class="description last">
- <p>Whether descendant nodes should be updated or not.</p>
- <p>Default is <code>false</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="worldToLocal" translate="no">.<a href="#worldToLocal">worldToLocal</a><span class="signature">( vector : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Converts the given vector from this 3D object's word space to local space.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>vector</strong>
- </td>
- <td class="description last">
- <p>The vector to convert.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The converted vector.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Events</h2>
- <h3 class="name name-method" id="event:added" translate="no">.<a href="#event:added">added</a> </h3>
- <div class="method">
- <div class="description">
- <p>Fires when the object has been added to its parent object.</p>
- </div>
- <h5>Type:</h5>
- <ul>
- <li>
- <span class="param-type">Object</span>
- </li>
- </ul>
- </div>
- <h3 class="name name-method" id="event:childadded" translate="no">.<a href="#event:childadded">childadded</a> </h3>
- <div class="method">
- <div class="description">
- <p>Fires when a new child object has been added.</p>
- </div>
- <h5>Type:</h5>
- <ul>
- <li>
- <span class="param-type">Object</span>
- </li>
- </ul>
- </div>
- <h3 class="name name-method" id="event:childremoved" translate="no">.<a href="#event:childremoved">childremoved</a> </h3>
- <div class="method">
- <div class="description">
- <p>Fires when a child object has been removed.</p>
- </div>
- <h5>Type:</h5>
- <ul>
- <li>
- <span class="param-type">Object</span>
- </li>
- </ul>
- </div>
- <h3 class="name name-method" id="event:removed" translate="no">.<a href="#event:removed">removed</a> </h3>
- <div class="method">
- <div class="description">
- <p>Fires when the object has been removed from its parent object.</p>
- </div>
- <h5>Type:</h5>
- <ul>
- <li>
- <span class="param-type">Object</span>
- </li>
- </ul>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/core/Object3D.js" translate="no" target="_blank" rel="noopener">src/core/Object3D.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|