SceneUtils.html 2.0 KB
Newer Older
1 2 3
<!DOCTYPE html>
<html lang="en">
	<head>
4
		<meta charset="utf-8" />
M
Mr.doob 已提交
5 6 7 8
		<base href="../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
9 10 11
	</head>
	<body>
		<h1>[name]</h1>
M
Mr.doob 已提交
12

13
		<p class="desc">A class containing useful utility functions for scene manipulation.</p>
M
Mr.doob 已提交
14 15


16
		<h2>Methods</h2>
M
Mr.doob 已提交
17 18


19
		<h3>[method:Group createMultiMaterialObject]( [param:Geometry geometry], [param:Array materials] )</h3>
20
		<p>
21
		geometry -- The geometry for the set of materials. <br />
G
gero3 已提交
22
		materials -- The materials for the object.
23 24
		</p>
		<p>
25
		Creates a new Group that contains a new mesh for each material defined in materials. Beware that this is not the same as an array of materials which defines multiple materials for 1 mesh.<br />
26
		This is mostly useful for objects that need both a material and a wireframe implementation.
27
		</p>
C
cjshannon 已提交
28

29
		<h3>[method:null attach]( [param:Object3D child], [param:Object3D scene], [param:Object3D parent] )</h3>
30
		<p>
G
gero3 已提交
31 32 33
		child -- The object to add to the parent  <br />
		scene -- The scene to detach the object on. <br />
		parent -- The parent to attach the object from.
34 35
		</p>
		<p>
G
gero3 已提交
36
		Attaches the object to the parent without the moving the object in the worldspace. Beware that to do this the matrixWorld needs to be updated, this can be done by calling the updateMatrixWorld method on the parent object.
37
		</p>
C
cjshannon 已提交
38

39
		<h3>[method:null detach]( [param:Object3D child], [param:Object3D parent], [param:Object3D scene] )</h3>
40
		<p>
G
gero3 已提交
41 42 43
		child -- The object to remove from the parent  <br />
		scene -- The scene to attach the object on. <br />
		parent -- The parent to detach the object from.
44 45
		</p>
		<p>
G
gero3 已提交
46
		Detaches the object from the parent and adds it back to the scene without moving in worldspace. Beware that to do this the matrixWorld needs to be updated, this can be done by calling the updateMatrixWorld method on the parent object.
47
		</p>
C
cjshannon 已提交
48

49
		<h2>Source</h2>
M
Mr.doob 已提交
50

M
Mugen87 已提交
51
		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/utils/SceneUtils.js examples/js/utils/SceneUtils.js]
52 53
	</body>
</html>