Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TargetCamera: Add Node Constructor code for TargetCamera #14827

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/dev/core/src/Cameras/targetCamera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import { Quaternion, Matrix, Vector3, Vector2, TmpVectors } from "../Maths/math.
import { Epsilon } from "../Maths/math.constants";
import { Axis } from "../Maths/math.axis";
import type { AbstractMesh } from "../Meshes/abstractMesh";
import { Node } from "../node";

Node.AddNodeConstructor("TargetCamera", (name, scene) => {
return () => new TargetCamera(name, Vector3.Zero(), scene);
});

/**
* A target camera takes a mesh or position as a target and continues to look at it while it moves.
* This is the base of the follow, arc rotate cameras and Free camera
Expand Down