whydoidoit / vector-extensions

PlayCanvas extension to pc.Vec3 to add inline chainable functions to add or set the X,Y,Z elements of a vector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

Utility extensions to PlayCanvas pc.Vec3 that add chainable methods to set elements of the vector.

Installation

npm install --save playcanvas-vector-extensions

Usage

import 'playcanvas-vector-extensions'

...

//Get vector to enemy ignoring Y
this.vector.copy(this.enemy.getPosition()).Y(0).sub(this.entity.getPosition()); 
 

Supports X(value), Y(value) and Z(value) as well as addX(value), addY(value) and addZ(value)

Requirements

Requires PlayCanvas Engine to be running on the page. Uses ES6/Babel/PlayCanvas template.

About

PlayCanvas extension to pc.Vec3 to add inline chainable functions to add or set the X,Y,Z elements of a vector


Languages

Language:JavaScript 100.0%