BeRo1985 / kraft

Kraft Physics Engine is an open source Object Pascal physics engine library that can be used in 3D games.
107 stars 21 forks source link

bug in raycast vehicle demo #27

Closed codz01 closed 1 year ago

codz01 commented 1 year ago

GIF 23-01-2023 17-17-44

BeRo1985 commented 1 year ago

Hm, I've fixed it actually with the last commits from the last days. Which compiler you're using and which version and for which CPU, and for which OS, and with with optimization options?

BeRo1985 commented 1 year ago

Can you try undefine all {$define SIMD} in the kraft.pas ?

BeRo1985 commented 1 year ago

With

image

I get as Win64 build:

g

with the latest changes from today,

BeRo1985 commented 1 year ago

FPC seems to have problems when a function result is also a function argument at the same time, regarding a creating a shadow temporary target for the result, or something. for example at a := Vector3Add(a, b); or a := Vector3Add(b, a);

at least I've workarounded it so far now for my own local FPC version build, by finetuned the function argument parameters per IFDEFs, for decide depending on the build-variant either if const or constref is used here, and either if it is inline pure-pascal or a inline assembler variant. For Delphi only const is used, since Delphi doesn't know constref. See the latest commits from the last days.

BeRo1985 commented 1 year ago

Okay, please test with https://github.com/BeRo1985/kraft/commit/d52968dca2b38d430cef4ba302fd67302ba7bb73 again

codz01 commented 1 year ago

thanks , yes it works now without problems

BeRo1985 commented 1 year ago

Okay good :-)

codz01 commented 1 year ago

forgot to mention my build system ;) kraft

optimization was -O3 only