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

Closed
AlexAPPi opened this issue Apr 30, 2024 · 3 comments
Closed

Add method for Node #6317

AlexAPPi opened this issue Apr 30, 2024 · 3 comments
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
Copy link
Contributor

@AlexAPPi So ive done some performance testing in #6625 and it doesn't seem like the performance gain is reasonable enough to warrant adding this method right now. If this issue was created for a personal project the chances of optimizing other areas would be much more successful that attempting to include this

@kpal81xd kpal81xd reopened this May 28, 2024
@kpal81xd kpal81xd closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 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