About Store Forum Documentation Contact



Post Reply 
How to update scale of physic shape of an object
Author Message
tipforeveryone Offline
Bronze Supporter

Post: #1
How to update scale of physic shape of an object
I am trying to change my object scale ingame by using`customMatrix.scaleOrnL(myCustomScale)`

mesh->draw(customMatrix) can display the mesh ok (e.g: myCustomScale = Vec(1, 3, 1))

but I cant update the same scale to physic shape of my object (the shape is still old scale) How can I do that. matrix(customMatrix) does not help

Shadow has the same problem with physic shape

https://i.gyazo.com/80d54667e6b26ceed9d3...3f07a3.png
https://i.gyazo.com/2d06309a54cc3f761292...1a9d91.png
(This post was last modified: 01-13-2024 01:52 AM by tipforeveryone.)
01-13-2024 01:47 AM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Bronze Supporter

Post: #2
RE: How to update scale of physic shape of an object
I still can see one axis scaling for object in editor still being kept when run the game. How can I do the same with my custom object
01-13-2024 04:01 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: How to update scale of physic shape of an object
For physics I think you have to just create actor with correct scale:
Code:
Bool createTry(C PhysPart    &part   , Flt density=1, C Vec &scale =1   , Bool kinematic=false); // create from PhysPart    , false on fail, 'density'=density multiplier, 'scale '=custom body  scale   , 'kinematic'=if create actor as kinematic
   Bool createTry(C PhysBody    &phys   , Flt density=1, C Vec &scale =1   , Bool kinematic=false); // create from PhysBody    , false on fail, 'density'=density multiplier, 'scale '=custom body  scale   , 'kinematic'=if create actor as kinematic
https://github.com/Esenthel/EsenthelEngi...Static.cpp
01-13-2024 04:31 AM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Bronze Supporter

Post: #4
RE: How to update scale of physic shape of an object
How can I get PhysBody from a created Game.Item ? I still stuck with this grin
And how to keep non-uniform scale for custom class object in editor ? E.G: X Scale = 0.5, Y Scale = 1, Z Scale = 0.7. Non Uniform scaling only apply on Terrain Class objects?
(This post was last modified: 01-24-2024 03:56 PM by tipforeveryone.)
01-24-2024 01:19 PM
Find all posts by this user Quote this message in a reply
Post Reply