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

After tutorial 47, the camera has inheritance issues #40

Open
DefenderofTheTimelines opened this issue Nov 10, 2019 · 0 comments
Open

Comments

@DefenderofTheTimelines
Copy link

When the camera is added as a child of testMesh1, the rotation and position are inherited properly.
When the camera is added as a child of testMesh2, the position is inherited, but rotation is not.
What I mean by this is if I rotate testMesh2 to "face" testMesh1, the camera will not start facing testMesh1, but the movement axes are correct. Code:


testMesh1.getTransform().getPosition().set(0, 2, 0);
testMesh1.getTransform().setRotation(new Quaternion(new Vector3f(0, 1, 0), 3.14159f/2));

testMesh2.getTransform().getPosition().set(0, 0, 10);
testMesh2.getTransform().setRotation(new Quaternion(new Vector3f(0, 1, 0), 3.14159f));

testMesh1.addChild(testMesh2);
testMesh2.addChild(camera);
getRootObject().addChild(testMesh1);


In my program, with the above code, the camera will start at position of testMesh2, but the camera is facing 90 degrees to the left, off the plane, instead of pointing at testMesh1. Even weirder, is the fact that moving forward moves camera toward testMesh1, and the other move axes all correspond to this.

In other words, the camera's move axes are correct, but it is not facing the correct direction, reguardless of the angle given to the second test mesh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant