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

Add method for Node #6317

Open
AlexAPPi opened this issue Apr 30, 2024 · 2 comments · May be fixed by #6625
Open

Add method for Node #6317

AlexAPPi opened this issue Apr 30, 2024 · 2 comments · May be fixed by #6625
Assignees
Labels
area: graphics Graphics related issue performance Relating to load times or frame rate

Comments

@AlexAPPi
Copy link

Now there are 2 methods available, setPosition and setRotation, I suggest adding 1 more method setPositionAndRotation.

public setPositionAndRotation(position: Readonly<pc.Vec3>, rotation: Readonly<pc.Quat>): void;

  • This will further optimize position and rotation manipulations
@mvaligursky mvaligursky added performance Relating to load times or frame rate area: graphics Graphics related issue labels Apr 30, 2024
@LeXXik
Copy link
Contributor

LeXXik commented Apr 30, 2024

I think we have an equivalent, or at least it is similar:

entity.getWorldTransform().setTRS(position, rotation, pc.Vec3.ONE);

@Maksims
Copy link
Contributor

Maksims commented Apr 30, 2024

A much bigger optimization many miss is to use setLocalPosition instead of setPosition where possible.

@kpal81xd kpal81xd linked a pull request May 24, 2024 that will close this issue
@kpal81xd kpal81xd self-assigned this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue performance Relating to load times or frame rate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants