Vec3

Vec3 Quick Jump / Table of Contents

  1. Vec3 Methods

Vec3 ( Vector3 ) is a scalar of 3 dimensions, x, y, and z.

vec3 = new Oak.Math.Vec3();
return vec3;

Vec3 Methods

vec3.set( x : number, y : number, z : number )

vec3.set( 12, 22, 5 );
return vec3;

vec3.clear( v : Vec3 )

vec3.set( 0, 22, 5 );
vec3.clear();
return vec3;

vec3.add( v : Vec3 )

vec3.clear();
add_vec = new Oak.Math.Vec3(); add_vec.set( 10, 5, 2 );
vec3.add( add_vec );
return vec3;

vec3.sub( v : Vec3 )

vec3.set( 10, 10, 10 );
sub_vec = new Oak.Math.Vec3(); sub_vec.set( 2, 5, 9 );
vec3.sub( sub_vec );
return vec3;

vec3.mul( v : Vec3 )

vec3.set( 10, 10, 10 );
mul_vec = new Oak.Math.Vec3(); mul_vec.set( 0.5, 2, 10 );
vec3.mul( mul_vec );
return vec3;

vec3.div( v : Vec3 )

vec3.mulI( v : Vec3 )

vec3.divI( v : Vec3 )

vec3.random( )

vec3.rotX( deg : number )

vec3.rotY( deg : number )

vec3.rotZ( deg : number )

vec3.flipX( )

vec3.flipY( )

vec3.dot( v : Vec3 )

vec3.copy( v : Vec3 )

vec3.pointTo( v : Vec3 )

vec3.dist( v : Vec3 )

vec3.mag( )

vec3.normalize( )

vec3.clone( )

vec3.invert( )

vec3.toArray( )

vec3.toString( )

vec3::fromValues( x : number, y : number, z : number )

All Pages in OakFrame Living Documentation

    OakFrame Living Documentation

    Simple to Embed and Integrate We designed OakFrame to be easy to extend in order to provide further integration opportunities. If you prefer to run your own code in web development environments, you will be able to download the entire source from GitHub. You can build a full web application with OakFrame or a simple […]

    Unread — 2 minute read

    SHIPP

    A SHIPP (Shift Pattern Properties) is a wrapper around 2-dimensional arrays so that they may be used in cases such as maps and path-finding implementations. map = new Oak.Math.SHIPP( 8, 16 ); map.placeCluster( -4, 0, 8, 8, 1); map.walkLine( 2, 1, 6, 14, "y"); table = document.createElement('div'); table.innerHTML = map.renderHTML({style:"class='slim'"}); print( table );

    Unread — 1 minute read

    RoomObject

    RoomObjects are entities that exist within a Room. They generally share behaviors with clones of themselves or similar entities. roomobject = new Oak.RoomObject(); return roomobject; RoomObject.ts Methods roomobject.setSprite( sprite : Sprite ) roomobject.getTags( ) return roomobject.getTags(); roomobject.getName() return roomobject.getName(); roomobject.getPosition() return roomobject.getPosition(); roomobject.render() print(roomobject.render()); roomobject.getBark() return roomobject.getBark(); roomobject.getScale() return roomobject.getScale(); roomobject.getTimelineEvent() return roomobject.getTimelineEvent(); roomobject.getTaskManager() return […]

    Unread — 1 minute read

    Sprite

    Sprites are used for loading images into the javascript context. Because animated GIFs are not native to javascript canvas, we can load up multiple images per sprite to act as frames of an animation. Sprite.ts Methods sprite.getImage() images = ["https://oakframe.org/wp-content/neighbors/sp_npc02.png", "https://oakframe.org/wp-content/neighbors/sp_npc02_mouthopen.png"]; wolfie = new Oak.Sprite({src:images}); return wolfie; sprite.getImage() will usually return false because the sprite […]

    Unread — 1 minute read

    Vec3

    Vec3 ( Vector3 ) is a scalar of 3 dimensions, x, y, and z. vec3 = new Oak.Math.Vec3(); return vec3; Vec3 Methods vec3.set( x : number, y : number, z : number ) vec3.set( 12, 22, 5 ); return vec3; vec3.clear( v : Vec3 ) vec3.set( 0, 22, 5 ); vec3.clear(); return vec3; vec3.add( v […]

    Reading — 1 minutes

    Surface

    Surfaces are an abstracted way to use the 2d context from within a single interface. Surfaces provide the functionality to draw seamlessly on a wide majority of available rendering devices. Surface.ts Methods surface.fill( color : String ) let surface = new Oak.Surface(); Oak.getContainer().appendChild(surface.getElement()); surface.fill('red'); surface.setSize( w : number, h : number ) let surface = […]

    Unread — 1 minute read

    Getting Started

    Unread — 0 minute read

    OakFrame App & Distributable

    Terminal.ts

    Unread — 1 minute read

    OakFrame Boot-Loader

    Because OakFrame is designed to run concurrently in any context, it is important for compilation, packaging, and delivering your app we recommend using a single boot-loader script to initialize your application. This ensures the main programs only get loaded once, and that there are fewer conflicts during app registrations.

    Unread — 1 minute read

OakFrame Living Documentation Topic Completion: 11%

Explore OakFrame

    Games

    Play games in your browser for free, handcrafted by us here at OakFrame!

    Unread — 1 minute read

    OakFrame Living Documentation

    Simple to Embed and Integrate We designed OakFrame to be easy to extend in order to provide further integration opportunities. If you prefer to run your own code in web development environments, you will be able to download the entire source from GitHub. You can build a full web application with OakFrame or a simple […]

    Unread — 2 minute read

    Design Systems

    A complete, reliable, flexible, and cost-effective infrastructure is a fundamental requirement in modern companies. Design Systems are a philosophy focused on creating reproducible results in a wide range of industries. By following design systems, your organization will more strongly align its service and products, and eliminate time spent re-building or designing infrastructure as much as […]

    Unread — 1 minute read

    About OakFrame

    OakFrame is a design, development, and research firm located in Dallas, Texas, developing experiences for audiences around the globe. We provide technology that helps you engage with the most amazing people online. With a proven track record of building interactive digital experiences across desktop and mobile to connect people, our mission is to provide people […]

    Unread — 1 minute read