Page 3 of 3

Re: conversion error on index_from_pointer

Posted: Wed Dec 01, 2021 7:33 am
by Jezza
L'In20Cible wrote:I was not able to reproduce:
I was expecting that, but yeah... gc.collect() used to work for me too, but for some reason it doesn't work properly sometimes, which is a mystery.
L'In20Cible wrote:Perhaps we could add a separate class for that, but as far as the current class is concerned, I think we should leave it as is because it is consistent with the engine. Adding a separate class seems easy enough if we use a shared abstract base class.
I don't know the implementation of IPhysicsObjectPairHash, so I can't say for sure, but why can't it be something like a regular two-dimensional array?
If we only refer to networked entities, I think that would be more efficient.

Re: conversion error on index_from_pointer

Posted: Wed Dec 01, 2021 7:46 am
by L'In20Cible
Jezza wrote:I don't know the implementation of IPhysicsObjectPairHash, so I can't say for sure, but why can't it be something like a regular two-dimensional array?
If we only refer to networked entities, I think that would be more efficient.

The physics engine internally uses that for that very purpose (g_EntityCollisionHash), so I think it is appropriate to re-use engine tools here. I've added an abstract base earlier, so feel free to make a PR with a class that inherit from ICollisionHash which respect the order, etc. It could be named OrderedCollisionHash, unless you have a better idea.

Re: conversion error on index_from_pointer

Posted: Fri Dec 03, 2021 12:10 pm
by velocity
Haven't tested CollisionHash, but I can confirm OnEntityCollision works. Very nice!