-
Notifications
You must be signed in to change notification settings - Fork 34
Update VoxelIndexKey
#42
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: phobos-dev
Are you sure you want to change the base?
Conversation
For #1767 use. |
@@ -302,27 +302,20 @@ struct VoxelCacheStruct | |||
|
|||
struct MainVoxelIndexKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MainVoxelIndexKey related stuffs are called at UnitClass::Draw_As_VXL
. At 0x73B5CB
. pThisUnit->Locomotion->Draw_Matrix
does the very beginning process. And the layout seems to be related with the specific loco.
All later usage of this index validates the key value to see if it -1, JumpjetLocomotionClass
and HoverLocomotionClass
forced it to be uncached if the FootClass object is rotated very hard. DriveLocomotionClass
and ShipLocomotionClass
filled the first 6 bits with current RampType. What is special is FlyLocomotionClass
, which seems quite different from the other locos.
My guess is that FlyLocomotionClass
use a unique index key calc system, JumpjetLocomotionClass
and HoverLocomotionClass
share the same calc system, DriveLocomotionClass
and ShipLocomotionClass
share the 6 bits holding for Ramp. And the others falls back to default base LocomotionClass
type.
You may have to check it again, and find out the corresponding relationship between those locos and the indexkeys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what you mean is: I need to write the special VoxelIndexKey
for FlyLoco
and RocketLoco
, and which bits of MainVoxelIndexKey
will be used in which places and under which circumstances, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what exactly should we do but Im pretty sure that Westwood didn't think too much on the index, they simply do bitshifts to make sure they are different (They don't care the exact bitfields layout). If we want to find out the exact meaning of each of them, then a "union" has to be used for different Locos.
Another solution is that we simply do what Westwood does, leave it as a int and don't care what the hell does it means exactly, as long as the index cannot be the same.
Maybe we should have a vote on this thing I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment at line 303
@Metadorius Maybe you should find some time and decide which impl should be used |
No description provided.