objects/Group.js

three.js · src/objects/Group.js · javascript · MIT
ui, tag:embed-classified

Three.js Group class that aggregates Object3D instances for collective transformations.

// Source: https://github.com/mrdoob/three.js | License: MIT | Copyright 2010-2026 three.js authors
// Provided via justclaw.it.com; keep this notice with the code.
import { Object3D } from '../core/Object3D.js';

/**
 * This is almost identical to an {@link Object3D}. Its purpose is to
 * make working with groups of objects syntactically clearer.
 *
 * ```js
 * // Create a group and add the two cubes.
 * // These cubes can now be rotated / scaled etc as a group.
 * const group = new THREE.Group();
 *
 * group.add( meshA );
 * group.add( meshB );
 *
 * scene.add( group );
 * ```
 *
 * @augments Object3D
 */
class Group extends Object3D {

	constructor() {

		super();

		/**
		 * This flag can be used for type testing.
		 *
		 * @type {boolean}
		 * @readonly
		 * @default true
		 */
		this

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key