Skip to content

TransformStat::get_mat() returns singular matrix on macOS #1625

Description

@el-dee

Description

When converting a TransformState into a matrix by using get_mat() I noticed recently that sometimes I get a singular matrix even if the transform state is perfectly valid. This seems to only occur on macOS, on Linux I never had the issue.
This happens on latest master but also with much older version but build now, so I suspect a problem with XCode or the third-party code. This happens with Panda3D build locally but also with the latest snapshot build.

Steps to Reproduce

I haven't been able to create a small reproducible example, but here is the dump of a NodePath that cause the problem :

 PandaNode root S:(AntialiasAttrib DepthTestAttrib ShaderAttrib)
   PandaNode scene-anchor T:(pos -24.9877 4.77565 -1.2761e-06 scale 0.001)
     PandaNode shifted-anchor
       PandaNode shape T:q(hpr 25.9029 -21.3056 10.007 scale 6367) S:(CullFaceAttrib CullBinAttrib DepthOffsetAttrib DepthWriteAttrib) (per-camera hidden)
         PandaNode root [] S:(ShaderAttrib)

The result of print(self.instance.get_net_transform()) gives :

T:q(pos -24.9877 4.77565 -1.2761e-06 hpr 25.9029 -21.3056 10.007 scale 6.367)

And print(self.instance.get_net_transform().get_mat()) returns a singular matrix :

0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

Environment

Metadata

Metadata

Assignees

Labels

interrogateusabilityStumbling blocks, papercuts, and other rough edges

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions