This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Skeleton(val name:String) { | |
val joints = new ArrayBuffer[Joint]() | |
val jointsByName = new HashMap[String, Joint]() // convenience only | |
var rootJoint:Option[Joint] = None | |
} | |
class Joint { | |
var name:String = "unnamed joint :-(" | |
val relativeTranslation = new Vector3d() // relative to parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum MyResult<T, Error: ErrorType> { | |
case Success(T) | |
case Failure(Error) | |
} | |
func doThing(@noescape block: (() -> Void)) throws { | |
try block() | |
} | |
func throwableToMyResult<T>(block: (() throws -> MyResult<T, NSError>)) -> MyResult<T, NSError> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use nalgebra as na; | |
use ncollide as nc; | |
use nalgebra::{Isometry3, Vector3}; | |
use ncollide::shape::{Cuboid, Cylinder}; | |
let cyl = Cylinder::new(0.925, 0.5); | |
let cyl_at = Isometry3::new(Vector3::new(10.97, 0.925, 61.02), na::zero()); | |
let cuboid = Cuboid::new(Vector3::new(0.05, 0.75, 0.5)); | |
let cuboid_at = Isometry3::new(Vector3::new(11.52, 0.75, 60.5), na::zero()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use nalgebra as na; | |
use ncollide as nc; | |
use nalgebra::{Isometry3, Vector3}; | |
use ncollide::shape::{Cuboid, Cylinder}; | |
let cyl = Cylinder::new(0.925, 0.5); | |
let cyl_at = Isometry3::new(Vector3::new(10.97, 0.925, 61.02), na::zero()); | |
let cuboid = Cuboid::new(Vector3::new(0.05, 0.75, 0.5)); | |
let cuboid_at = Isometry3::new(Vector3::new(11.50, 0.75, 60.5), na::zero()); |