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

PotS Physical Transforms #101

Closed
Hoikas opened this issue Jul 8, 2018 · 5 comments
Closed

PotS Physical Transforms #101

Hoikas opened this issue Jul 8, 2018 · 5 comments
Labels

Comments

@Hoikas
Copy link
Member

Hoikas commented Jul 8, 2018

Per @Jrius in #93 and on the forum, Plasma engines that utilize Havok physics expect for most static physicals' data to be in worldspace coordinates while others (specifically pinned and massed physicals) are expected to be in localspaced. Korman currently exports physical data in localspace coordinates only, which works on MOUL.

A work-around for ladders was introduced in #94 to apply the kPinned flag and a mass of 1.0 to the physical. However, this does not address the fact that we are producing physicals that are potentially incorrect for PotS. We should investigate either applying transforms as a post export step on these physicals or applying this workaround to all PotS physicals.

@Hoikas Hoikas added the defect label Jul 8, 2018
@Deledrius
Copy link
Member

If we can do it as a version-specific export step, that sounds like the best option. Otherwise it will be forgotten in new features and cause future bugs.

@Hoikas
Copy link
Member Author

Hoikas commented Jul 9, 2018

Any preference for applying the mass/pin hack or transforming everything to worldspace?

@Jrius
Copy link
Collaborator

Jrius commented Jul 9, 2018

As far as I know, both usually work fine.
Obviously moving objects need to have mass and kPinned, but transforming everything to world space can (theoretically) yield slightly better performances for static meshes.
From Cyan's PRP it seems the preferred behavior is no mass for regular colliders, no mass and kPinned for exclude regions, and mass+kPinned for kickables and detectors (except exclude regions).
Animated colliders (for instance, subworlds) have the kPhysAnim flag. Kickables don't.
I have followed these rules when fixing Myst V logic on Complete Chronicles, always worked as expected. (The only exception being in Laki's Maze, when a physical object was parented to a ViewFaceModifier, but that's asking for trouble.)

@Deledrius
Copy link
Member

I'd say the safest bet for predictability and compatibility would be to follow that pattern then.

@Hoikas
Copy link
Member Author

Hoikas commented Sep 3, 2018

The current approach is to transform physicals into worldspace if the scene object does not have a coordinate interface.

@Hoikas Hoikas closed this as completed in c98f3fe Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants