Giter VIP home page Giter VIP logo

p2.d.ts's Introduction

p2.d.ts

Typescript Definition File for p2.js

p2.d.ts's People

Contributors

clark-stevenson avatar elisee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

p2.d.ts's Issues

How to use this with nodejs?

I've, downloaded the p2 package via npm for nodejs.
How do I use the p2.d.ts with this package? Can you give an example?

/// <reference path='../typings/p2/p2.d.ts' />
import p2 = require('p2'); // <---- this causes 'p2 module not found' error (TS2307)
import GameObject = require('./GameObjectNew');
import player = require('./asset/PlayerNew');


class Game {

    gameObjects: GameObject[] = [];
    players: GameObject[] = [];
    sessionEvents = [];
    globalEvents = [];

    world: p2.World = new p2.World({
        gravity: [0.0, 0.0]
    });

.........

Should we use Tuples instead of number[]?

p2 uses an array length 2 of number type to define vector such as position. number[] is annoying but works.

Does anyone have any issues with changing all number[](in context) to something like this? I suppose finding the correct name is my problem since vec2 exists already as a class with static members.

export interface IVec2 extends Array<number | number> {
        0?: number;
        1?: number;
}

Any opinion would be great.

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.