Coder Social home page Coder Social logo

physics.inc's People

Contributors

kar2k avatar upeppe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

physics.inc's Issues

Issues updating physics.inc to latest

Due to the confusion with SA-MP forums deleting the topic (sigh.. yet another topic), I didnt realize my physics.inc file was ancient. Fortunately, I found the new forum topic on bugershot forums. I tried looking through the commits on this repository, but some of the old functions I use aren't even on here, even dating back to 0.1! I'm trying to update my physics.inc to the latest. I've had pretty good luck so far (GetHandle -> GetObject, SetHandle -> SetObject). I am on the last function change, but I can't seem to find a suitable replacement for it, without having to restructure the whole code that uses physics.


physics.old.inc (unknown version)
#define PHY_GetHandleObject(%1) (PHY_Object[%1][PHY_DynamicObject])

It seems this old include uses PHY_DynamicObject, to store the object id internally. Starting with the repository, this function was completely removed.


I've attached the unknown physics.old.inc include to help determine what version it is; and further pinpoint what changes need to be made to make it compatible with the latest version.

physics.old.txt


I've also attached snippets from functions throughout the script that contain this function, in order to better understand how the module utilizes this include.

Here are the lines in the code which contain the function: 28, 66, 107, 141, 164, 272, 290, 309, 337, 493, 522, 539

snippets.pwn.txt

Ainda falta a colisão com veículos

It wouldn't exactly be a problem.

But the collision with vehicles is still missing.

Collision of objects with vehicles to make many very cool mini-games.

Can you attach this to your project?

sorry for my bad english

Further optimizations

Codes like this could be optimized significantly using VectorSize

Codes below seems to be very slow according to performance profiler results..
stock IsObjectInSphere(objectid,Float:x,Float:y,Float:z,Float:radius2) { new Float:x1,Float:y1,Float:z1,Float:tmpdis; GetObjectPos(objectid,x1,y1,z1); tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)+ floatpower(floatabs(floatsub(y,y1)),2)+ floatpower(floatabs(floatsub(z,z1)),2)); // if(tmpdis < radius2) return 1; return 0; }

to

`IsObjectInSphere(objectid, Float:x, Float:y, Float:z, Float:radius2)
{
new Float:x1, Float:y1, Float:z1;

if (GetObjectPos(objectid, x1, y1, z1)) // object exists
{
    return VectorSize(x1-x, y1-y, z1-z) <= radius2;
}
return 0;

}`
a more optimized version

Perhaps you could consider doing major optimizations on the scripts so it performs better

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.