IllegalCastException problem found in the engine

IllegalCastException problem found in the engine

Mensagempor Rakosmanjr » 06 Fev 2012, 05:18

Clique para: Ver
Found an error in the engine and i thought i might post it here so someone who knows what there doing could change it. Inside FullCharecterObject.cs its PhysicObjectTypes is set to PhysicObjectTypes.CHARECTEROBJECT. This causes an illegal cast exception thou, when you try to add an IObject, using FullCharecterObject, to the world.

Inside of BepuPhysicWorld.SddObject() method, the FullCharecterObject is read as a CharecterObject and then cast as such. To me, it looks as though another enum value is needed to support the FullCharecterObject.

Just informed that its not supported. So the error is now nil.

Also, on a side note, to slightly speed up the AddObject() and RemoveObject() methods, the tests inside the if statements should be done with "is", and the the casts should be done with "obj as ...".
Rakosmanjr
 
Mensagens: 11
Registrado em: 16 Out 2011, 18:11
Area: Programador

Re: IllegalCastException problem found in the engine

Mensagempor tpastor » 06 Fev 2012, 19:33

hi.
This is a know problem with the beta 2 version.
You can grab our current development version here http://code.google.com/p/port-ploobsengine/source/checkout with this improvement
.
In this version you will have 3 character objects:
    The old one (capsule + box - actually one used in the demos)
    The full character (cylinder)
    The Sphere Character
Editado pela última vez por tpastor em 06 Fev 2012, 19:39, em um total de 2 vezes.
PloobsEngine
Creator and Developer
ploobs.com.br/?page_id=1381
Avatar do usuário
tpastor
TechDemo
 
Mensagens: 700
Registrado em: 25 Mar 2011, 16:40

Re: IllegalCastException problem found in the engine

Mensagempor tpastor » 06 Fev 2012, 19:37

Comparing structs (int) is a bit faster than comparing types (using is).
The second part i agree with you. (as is faster than regular casting).
But this wont impact in performance, cause add and remove arent used intensively.

Thanks for pointing the problem !
PloobsEngine
Creator and Developer
ploobs.com.br/?page_id=1381
Avatar do usuário
tpastor
TechDemo
 
Mensagens: 700
Registrado em: 25 Mar 2011, 16:40


Voltar para Core

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante

cron