GithubHelp home page GithubHelp logo

gjp's Introduction

GJP

Deterministic intersection engine for c#, it does the complicated work for you like calculations but leaves things like how you separate two objects when they collide up to you.

Not very robust, but not especially confusing either... at least i think so.

Weird commit messages may come as i update this, but remember: it's the only way i can stay motivated, so it's for the worst but it's the only way.

Guide

  • Use the static constructors of the shapes like ConvexPolygon.CreateRect and CircleShape.CreateCircle to create Shape instances.

  • Create a simulation with DtCollisionSimulation.

  • Set the simulation for the Shape with the SetSimulation method found in it.

  • Execute the Tick method of the simulation when the game updates.

  • After the simulation is set on the shape, set IsActive to true if it exists in the simulation and to false if it's in stasis.

  • Use the Detecting bool of the shape instance after you already set the simulation to make the shape start actually detecting stuff. (not necessary with shapes that just need to be detected like terrain and moving plataforms)

  • Use the IntersectOnly bool to determine wether or not a object is NOT solid and DOES NOT solve overlap.

  • Use the Shape's StepAmount to determine if the motion is segmented or not.

  • Keep in mind that the ObjectUsingIt reference on the shape instance is what determines the response to all collision based on the information given to it. The methods found in the interface CollisionAntenna wich the ObjectUsingIt inherits will be signaled when the shape detects something or is detected by something, so write code to handle that.

  • Finally, when disposing of a Shape instance, always use the Dispose method found in it.

Lacking features

  • Object pooling, since computers hates deleting memory. (FIXED, please report any bugs)

  • Segmented motion for people that want to make fast objects. (FIXED, please report any bugs)

  • Raycast.

gjp's People

Stargazers

 avatar

Watchers

 avatar

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.