public void StringCompatibility() { const string s1 = "0.123456 0.987654"; var a = new SFVec2f(0.123456f, 0.987654f); Assert.AreEqual(s1, a.ToString()); }
public void HashCode() { var a = new SFVec2f(); var b = new SFVec2f(); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public x3dTextureTransform() { Center = new SFVec2f(0, 0); Rotation = 0; Scale = new SFVec2f(1, 1); Translation = new SFVec2f(0, 0); }
public void visit(MFVec2f field) { field.clearValues(); ParseMField((subcontext) => { var child = new SFVec2f(); this.visit(child); field.AppendValue(child); }); }
public x3dPlaneSensor() { AutoOffset = true; AxisRotation = new SFRotation(0, 0, 1, 0); Description = ""; Enabled = true; MaxPosition = new SFVec2f(-1, -1); MinPosition = new SFVec2f(0, 0); Offset = new SFVec3f(0, 0, 0); }
public void Constructor() { var a = new SFVec2f(); Assert.IsTrue(Math.Abs(a.X - 0.0f) < EPSILON); Assert.IsTrue(Math.Abs(a.Y - 0.0f) < EPSILON); var b = new SFVec2f(1, 1); Assert.IsTrue(Math.Abs(b.X - 1.0f) < EPSILON); Assert.IsTrue(Math.Abs(b.Y - 1.0f) < EPSILON); }
public x3dCollisionCollection() { AppliedParameters = new List <string>(); AppliedParameters.Add("BOUNCE"); Bounce = 0; Collidables = new List <IX3DCollisionCollectionCollidables>(); Enabled = true; FrictionCoefficients = new SFVec2f(0, 0); MinBounceSpeed = 0.1; SlipFactors = new SFVec2f(0, 0); SoftnessConstantForceMix = 0.0001; SoftnessErrorCorrection = 0.8; SurfaceSpeed = new SFVec2f(0, 0); }
public void ObjectEquality() { var a = new SFVec2f(0.123456f, 0.987654f); var b = new SFVec2f(0.123456f, 0.987654f); var c = new SFVec2f(0.987654f, 0.123456f); Assert.AreEqual(a, b); Assert.AreNotEqual(a, c); Assert.AreNotEqual(b, c); Assert.AreEqual(a, a); Assert.AreEqual(c, c); Assert.AreNotEqual(c, false); }
public x3dParticleSystem() { CreateParticles = true; Enabled = true; LifetimeVariation = 0.25; MaxParticles = 200; ParticleLifetime = 5; ParticleSize = new SFVec2f(0.02, 0.02); BBoxCenter = new SFVec3f(0, 0, 0); BBoxSize = new SFVec3f(-1, -1, -1); ColorKey = new List <double>(); GeometryType = "QUAD"; Physics = new List <X3DParticlePhysicsModelNode>(); TexCoordKey = new List <double>(); }
public x3dContact() { AppliedParameters = new List <string>(); AppliedParameters.Add("BOUNCE"); Bounce = 0; ContactNormal = new SFVec3f(0, 1, 0); Depth = 0; FrictionCoefficients = new SFVec2f(0, 0); FrictionDirection = new SFVec3f(0, 1, 0); MinbounceSpeed = 0; Position = new SFVec3f(0, 0, 0); SlipCoefficients = new SFVec2f(0, 0); SoftnessConstantForceMix = 0.0001; SoftnessErrorCorrection = 0.8; SurfaceSpeed = new SFVec2f(0, 0); }
internal SFVec2f ParseSFVec2fValue() { // float float try { SFVec2f ret = new SFVec2f(); ret.X = ParseDoubleValue(); ret.Y = ParseDoubleValue(); return(ret); } catch (UserCancellationException) { throw; } catch (Exception ex) { ErrorParsingField(VRMLReaderError.SFVec2fInvalid, ex); } return(null); }
internal override bool ParseNodeBodyElement(string id, VRMLParser parser) { if (id == "center") { Center = parser.ParseSFVec2fValue(); } else if (id == "rotation") { Rotation = parser.ParseDoubleValue(); } else if (id == "scale") { Scale = parser.ParseSFVec2fValue(); } else if (id == "translation") { Translation = parser.ParseSFVec2fValue(); } else { return(false); } return(true); }
public void Visit(SFVec2f field) { throw new NotImplementedException(); }
public void visit(SFVec2f field) { field.X = context.ReadFloat(); field.Y = context.ReadFloat(); }
public void visit(SFVec2f field) { throw new NotImplementedException(); }
internal override bool ParseNodeBodyElement(string id, VRMLParser parser) { int line = parser.Line; if (id == "appliedParameters") { if (wasAppliedParameters) { AppliedParameters.AddRange(parser.ParseSFStringOrMFStringValue()); } AppliedParameters = parser.ParseSFStringOrMFStringValue(); wasAppliedParameters = true; } else if (id == "bounce") { Bounce = parser.ParseDoubleValue(); } else if (id == "collidables") { List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue(); foreach (X3DNode node in nodes) { IX3DCollisionCollectionCollidables colls = node as IX3DCollisionCollectionCollidables; if (colls == null) { parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line); } else { Collidables.Add(colls); } } } else if (id == "enabled") { Enabled = parser.ParseBoolValue(); } else if (id == "frictionCoefficients") { FrictionCoefficients = parser.ParseSFVec2fValue(); } else if (id == "minBounceSpeed") { MinBounceSpeed = parser.ParseDoubleValue(); } else if (id == "slipFactors") { SlipFactors = parser.ParseSFVec2fValue(); } else if (id == "softnessConstantForceMix") { SoftnessConstantForceMix = parser.ParseDoubleValue(); } else if (id == "softnessErrorCorrection") { SoftnessErrorCorrection = parser.ParseDoubleValue(); } else if (id == "surfaceSpeed") { SurfaceSpeed = parser.ParseSFVec2fValue(); } else { return(false); } return(true); }
public void Visit(SFVec2f field) { field.X = m_context.ReadFloat(); field.Y = m_context.ReadFloat(); }
internal override bool ParseNodeBodyElement(string id, VRMLParser parser) { if (id == "appliedParameters") { if (wasAppliedParameters) { AppliedParameters.AddRange(parser.ParseSFStringOrMFStringValue()); } AppliedParameters = parser.ParseSFStringOrMFStringValue(); wasAppliedParameters = true; } else if (id == "bounce") { Bounce = parser.ParseDoubleValue(); } else if (id == "contactNormal") { ContactNormal = parser.ParseSFVec3fValue(); } else if (id == "depth") { Depth = parser.ParseDoubleValue(); } else if (id == "frictionCoefficients") { FrictionCoefficients = parser.ParseSFVec2fValue(); } else if (id == "frictionDirection") { FrictionDirection = parser.ParseSFVec3fValue(); } else if (id == "minbounceSpeed") { MinbounceSpeed = parser.ParseDoubleValue(); } else if (id == "position") { Position = parser.ParseSFVec3fValue(); } else if (id == "slipCoefficients") { SlipCoefficients = parser.ParseSFVec2fValue(); } else if (id == "softnessConstantForceMix") { SoftnessConstantForceMix = parser.ParseDoubleValue(); } else if (id == "softnessErrorCorrection") { SoftnessErrorCorrection = parser.ParseDoubleValue(); } else if (id == "surfaceSpeed") { SurfaceSpeed = parser.ParseSFVec2fValue(); } else { return(false); } return(true); }
public x3dRectangle2D() { Size = new SFVec2f(2, 2); Solid = false; }