public PBRRay(PBRPoint3 p, PBRVector3 d, float tm = float.PositiveInfinity, float rt = 0.0f) { _origin = new PBRPoint3(p); _direction = new PBRVector3(d); _tMax = tm; _rTime = rt; }
public PBRRay(PBRRay r) { _origin = new PBRPoint3(r.Origin); _direction = new PBRVector3(r.Direction); _tMax = r.TMax; _rTime = r.RTime; }
public PBRPoint3 Lerp(PBRPoint3 p) { return(new PBRPoint3( Mathf.Lerp(p.X, _pMin.X, _pMax.X), Mathf.Lerp(p.Y, _pMin.Y, _pMax.Y), Mathf.Lerp(p.Z, _pMin.Z, _pMax.Z))); }
public PBRRay() { _origin = new PBRPoint3(); _direction = new PBRVector3(); _tMax = float.PositiveInfinity; _rTime = 0.0f; }
public void ScaleDifferential(float s) { rxOrigin = _origin + (rxOrigin - _origin) * s; ryOrigin = _origin + (ryOrigin - _origin) * s; rxDirection = _direction + (rxDirection - _direction) * s; ryDirection = _direction + (ryDirection - _direction) * s; }
public Interaction(PBRPoint3 po, PBRNormals normal, PBRVector3 err, PBRVector3 w, float t) { _time = t; _normal = new PBRNormals(normal); _oError = new PBRVector3(err); wo = new PBRVector3(w); _p = new PBRPoint3(po); }
public bool Equals(object obj) { if (obj is PBRVector3) { PBRPoint3 v = (PBRPoint3)obj; return(this._x == v.X && this._y == v.Y); } return(false); }
public PBRTransform LookAt(PBRPoint3 pos, PBRPoint3 look, PBRVector3 up) { Matrix4x4 cameraToWorld = new Matrix4x4(); cameraToWorld.M[0, 3] = pos.X; cameraToWorld.M[1, 3] = pos.Y; cameraToWorld.M[2, 3] = pos.Z; cameraToWorld.M[2, 3] = 1; return(null); }
public static BoundingBox3D Union(BoundingBox3D b1, BoundingBox3D b2) { PBRPoint3 pmin = new PBRPoint3(Mathf.Min(b1.PMin.X, b2.PMin.X), Mathf.Min(b1.PMin.Y, b2.PMin.Y), Mathf.Min(b1.PMin.Z, b2.PMin.Z)); PBRPoint3 pmax = new PBRPoint3(Mathf.Max(b1.PMax.X, b2.PMax.X), Mathf.Max(b1.PMax.Y, b2.PMax.Y), Mathf.Max(b1.PMax.Z, b2.PMax.Z)); return(new BoundingBox3D(pmin, pmax)); }
public PBRVector3 Offset(PBRPoint3 p) { PBRVector3 o = p - _pMin; if (_pMax.X > _pMin.X) { p.X /= _pMax.X - _pMin.X; } if (_pMax.Y > _pMin.Y) { p.Y /= _pMax.Y - _pMin.Y; } if (_pMax.Z > _pMin.Z) { p.Z /= _pMax.Z - _pMin.Z; } return(o); }
public void BoundingSphere(out PBRPoint3 center, out float rad) { center = (_pMin + _pMax) / 2.0f; rad = 0; }
public BoundingBox3D(PBRPoint3 p1, PBRPoint3 p2) { _pMin = new PBRPoint3(p1); _pMax = new PBRPoint3(p2); }
public PBRPoint3(PBRPoint3 v) : base(v) { }
public BoundingBox3D() { _pMax = new PBRPoint3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity); _pMin = new PBRPoint3(0, 0, 0); }
public BoundingBox3D(PBRPoint3 p) { _pMax = new PBRPoint3(p); _pMin = new PBRPoint3(p); }
public static bool InsideExclusive(PBRPoint3 p, BoundingBox3D b) { return((p.X >= b.PMin.X && p.X < b.PMax.X) && (p.Y >= b.PMin.Y && p.Y < b.PMax.Y) && (p.Z >= b.PMin.Z && p.Z < b.PMax.Z)); }
public PBRRayDifferential(PBRPoint3 p, PBRVector3 d, float tMax = float.PositiveInfinity, float pTime = 0.0f) : base(p, d, tMax, pTime) { _hasDifferentials = false; }
public static bool Inside(PBRPoint3 p, BoundingBox3D b) { return(p.X >= b.PMin.X && p.X <= b.PMax.X && p.Y >= b.PMin.Y && p.Y <= b.PMax.Y && p.Z >= b.PMin.Z && p.Z <= b.PMax.Z); }
public static PBRPoint3 Ceiling(PBRPoint3 p1) { return(new PBRPoint3((float)Math.Ceiling(p1.X), (float)Math.Ceiling(p1.Y), (float)Math.Ceiling(p1.Z))); }
public float Distance(PBRPoint3 p1, PBRPoint3 p2) { return((p2 - p1).Length()); }
public float DistanceSquare(PBRPoint3 p1, PBRPoint3 p2) { return((p2 - p1).LengthSquared()); }
public static PBRPoint3 floor(PBRPoint3 p1) { return(new PBRPoint3((float)Math.Floor(p1.X), (float)Math.Floor(p1.Y), (float)Math.Floor(p1.Z))); }