Ali_RS
June 11, 2019, 10:48am
21
Also, should we call clearCollisionData
after resizing MBox?
BIHTree tree = new BIHTree(this); tree.construct(); collisionTree = tree; } /** * Clears any previously generated collision data. Use this if * the mesh has changed in some way that invalidates any previously * generated BIHTree. */ public void clearCollisionData() { collisionTree = null; } /** * Handles collision detection, internal use only. * User code should only use collideWith() on scene * graph elements such as {@link Spatial}s. */ public int collideWith(Collidable other, Matrix4f worldMatrix,
Probably after this line?
verts.flip(); texes.flip(); setBuffer(Type.Index, 3, index); setBuffer(Type.Position, 3, verts); setBuffer(Type.TexCoord, 2, texes); setBuffer(Type.Normal, 3, norms); updateBound(); } protected float[] spread( float min, float max, int count ) { float[] result = new float[count]; float delta = (max - min); float step = 1.0f / (count - 1); // 2 verts is 1 step for( int i = 0; i < count; i++ ) { result[i] = min + (delta * i * step);
pspeed
June 11, 2019, 10:57am
22
Yeah, probably. No harm clearing it, I guess.
1 Like
Ali_RS
June 11, 2019, 2:54pm
23
@pspeed , I made a new PR for this:
It is already tested.
jMonkeyEngine-Contributions:master
← Ali-RS:fix-mbox
opened 02:59PM - 11 Jun 19 UTC
pspeed
June 11, 2019, 2:58pm
24
Someday, someone should fix JME serialization to work with protected/private constructors. Of course, that probably requires special dispensation in Java 11… but so be it.
3 Likes
Ali_RS
June 11, 2019, 3:00pm
25
Should I fill an issue for this on JME GitHub page?
pspeed
June 11, 2019, 3:08pm
26
I don’t know… wouldn’t hurt to keep track of it, I guess.
tlf30
June 11, 2019, 3:15pm
27
As long as the module definition allows for reflection access, it should not be an issue.
1 Like
Ali_RS
June 11, 2019, 3:20pm
28
I guess Paul means that it is ugly to impose a public NO-Arg Constructor just for sake of serialization.
tlf30
June 11, 2019, 3:25pm
29
Hmm… I see what you are saying. I have done it in the past, I will check how I did it.
pspeed
June 11, 2019, 3:26pm
30
You just have to use reflection to grab the no-arg constructor and make setAccessible(true) or whatever.
…which just requires special permissions in newer Java, I guess.
1 Like
Ali_RS
June 11, 2019, 3:27pm
31
I made a new thread for it. We can continue the discussion about it there:
2 Likes