public void visit(SFRotation field) { field.X = context.ReadFloat(); field.Y = context.ReadFloat(); field.Z = context.ReadFloat(); field.Angle = context.ReadFloat(); }
public void StringCompatibility() { const string s = "0.456789 0.654321 0.000001 1.123456"; var a = new SFRotation(0.456789f, 0.654321f, 0.000001f, 1.123456f); Assert.AreEqual(s, a.ToString()); }
public x3dTextureTransform3D() { Center = new SFVec3f(0, 0, 0); Rotation = new SFRotation(0, 0, 1, 0); Scale = new SFVec3f(1, 1, 1); Translation = new SFVec3f(0, 0, 0); }
public void HashCode() { var a = new SFRotation(); var b = new SFRotation(); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public x3dSphereSensor() { AutoOffset = true; Description = ""; Enabled = true; Offset = new SFRotation(0, 1, 0, 0); }
public x3dRigidBody() { AngularDampingFactor = 0.001; AngularVelocity = new SFVec3f(0, 0, 0); AutoDamp = false; AutoDisable = false; CenterOfMass = new SFVec3f(0, 0, 0); DisableAngularSpeed = 0; DisableLinearSpeed = 0; DisableTime = 0; Enabled = true; FiniteRotationAxis = new SFVec3f(0, 0, 0); Fixed = false; Forces = new List <SFVec3f>(); Geometry = new List <X3DNBodyCollidableNode>(); Inertia = new SFMatrix3f(new List <double>(new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 })); LinearDampingFactor = 0.001; LinearVelocity = new SFVec3f(0, 0, 0); Mass = 1; Orientation = new SFRotation(0, 0, 1, 0); Position = new SFVec3f(0, 0, 0); Torques = new List <SFVec3f>(); UseFiniteRotation = false; UseGlobalGravity = true; }
public void Visit(SFRotation field) { field.X = m_context.ReadFloat(); field.Y = m_context.ReadFloat(); field.Z = m_context.ReadFloat(); field.Angle = m_context.ReadFloat(); }
public x3dCollidableOffset() { Enabled = true; Rotation = new SFRotation(0, 0, 1, 0); Translation = new SFVec3f(0, 0, 0); BBoxCenter = new SFVec3f(0, 0, 0); BBoxSize = new SFVec3f(-1, -1, -1); }
public void visit(MFRotation field) { field.clearValues(); ParseMField((subcontext) => { var child = new SFRotation(); 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 x3dViewpoint() { CenterOfRotation = new SFVec3f(0, 0, 0); Description = ""; FieldOfView = Math.PI / 4; Jump = true; Orientation = new SFRotation(0, 0, 1, 0); Position = new SFVec3f(0, 0, 10); RetainUserOffsets = false; }
public x3dCylinderSensor() { AutoOffset = true; AxisRotation = new SFRotation(0, 1, 0, 0); Description = ""; DiskAngle = Math.PI / 12; Enabled = true; MaxAngle = -1; MinAngle = 0; Offset = 0; }
public x3dTransform() { Center = new SFVec3f(0, 0, 0); Children = new List <X3DChildNode>(); Rotation = new SFRotation(0, 0, 1, 0); Scale = new SFVec3f(1, 1, 1); ScaleOrientation = new SFRotation(0, 0, 1, 0); Translation = new SFVec3f(0, 0, 0); BBoxCenter = new SFVec3f(0, 0, 0); BBoxSize = new SFVec3f(-1, -1, -1); }
public x3dOrthoViewpoint() { CenterOfRotation = new SFVec3f(0, 0, 0); Description = ""; FieldOfView = new List <double>(); FieldOfView.Add(-1); FieldOfView.Add(-1); FieldOfView.Add(1); FieldOfView.Add(1); Jump = true; Orientation = new SFRotation(0, 0, 1, 0); Position = new SFVec3f(0, 0, 10); RetainUserOffsets = false; }
public void ObjectEquality() { var a = new SFRotation(0.456789f, 0.654321f, 0.000001f, 1.0f); var b = new SFRotation(0.456789f, 0.654321f, 0.000001f, 1.0f); var c = new SFRotation(0.654321f, 0.456789f, 0.000001f, 1.0f); 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 void ElementAssignment() { var a = new SFRotation(); a.X = 1; a.Y = 1; a.Z = 1; a.Angle = 1; Assert.IsTrue(Math.Abs(a.X - 1.0f) < EPSILON); Assert.IsTrue(Math.Abs(a.Y - 1.0f) < EPSILON); Assert.IsTrue(Math.Abs(a.Z - 1.0f) < EPSILON); Assert.IsTrue(Math.Abs(a.Angle - 1.0f) < EPSILON); }
public x3dGeoTransform() { Children = new List <X3DChildNode>(); GeoCenter = new SFVec3f(0, 0, 0); Rotation = new SFRotation(0, 0, 1, 0); Scale = new SFVec3f(1, 1, 1); ScaleOrientation = new SFRotation(0, 0, 1, 0); Translation = new SFVec3f(0, 0, 0); BBoxCenter = new SFVec3f(0, 0, 0); BBoxSize = new SFVec3f(-1, -1, -1); GeoSystem = new List <string>(); GeoSystem.Add("GD"); GeoSystem.Add("WE"); }
public void Constructor() { var a = new SFRotation(); Assert.IsTrue(Math.Abs(a.X - 0.0f) < EPSILON); Assert.IsTrue(Math.Abs(a.Y - 0.0f) < EPSILON); Assert.IsTrue(Math.Abs(a.Z - 1.0f) < EPSILON); Assert.IsTrue(Math.Abs(a.Angle - 0.0f) < EPSILON); var b = new SFRotation(1, 1, 1, 1); Assert.IsTrue(Math.Abs(b.X - 1.0f) < EPSILON); Assert.IsTrue(Math.Abs(b.Y - 1.0f) < EPSILON); Assert.IsTrue(Math.Abs(b.Z - 1.0f) < EPSILON); Assert.IsTrue(Math.Abs(b.Angle - 1.0f) < EPSILON); }
public x3dGeoViewpoint() { CenterOfRotation = new SFVec3f(0, 0, 0); Description = ""; FieldOfView = Math.PI / 4; Headlight = true; Jump = true; NavType = new List <string>(); NavType.Add("EXAMINE"); NavType.Add("ANY"); GeoSystem = new List <string>(); GeoSystem.Add("GD"); GeoSystem.Add("WE"); Orientation = new SFRotation(0, 0, 1, 0); Position = new SFVec3f(0, 0, 100000); RetainUserOffsets = false; SpeedFactor = 1.0; }
public x3dHAnimJoint() { Center = new SFVec3f(0, 0, 0); Children = new List <X3DChildNode>(); Displacers = new List <IX3DHAnimDisplacerNode>(); LimitOrientation = new SFRotation(0, 0, 1, 0); Llimit = new List <double>(); Name = ""; Rotation = new SFRotation(0, 0, 1, 0); Scale = new SFVec3f(1, 1, 1); ScaleOrientation = new SFRotation(0, 0, 1, 0); SkinCoordIndex = new List <int>(); SkinCoordWeight = new List <double>(); Stiffness = new List <double>(new double[] { 0, 0, 0 }); Translation = new SFVec3f(0, 0, 0); Ulimit = new List <double>(); BBoxCenter = new SFVec3f(0, 0, 0); BBoxSize = new SFVec3f(-1, -1, -1); }
public x3dHAnimHumanoid() { Center = new SFVec3f(0, 0, 0); Info = new List <string>(); Joints = new List <IX3DHAnimJointNode>(); Name = ""; Rotation = new SFRotation(0, 0, 1, 0); Scale = new SFVec3f(1, 1, 1); ScaleOrientation = new SFRotation(0, 0, 1, 0); Segments = new List <IX3DHAnimeSegmentNode>(); Sites = new List <IX3DHAnimSiteNode>(); Skeleton = new List <IX3DHAnimHumanoidSkeleton>(); Skin = new List <X3DChildNode>(); Translation = new SFVec3f(0, 0, 0); Version = ""; Viewpoints = new List <X3DViewpointNode>(); BBoxCenter = new SFVec3f(0, 0, 0); BBoxSize = new SFVec3f(-1, -1, -1); }
internal SFRotation ParseSFRotationValue() { // float float float float try { SFRotation ret = new SFRotation(); ret.X = ParseDoubleValue(); ret.Y = ParseDoubleValue(); ret.Z = ParseDoubleValue(); ret.Angle = ParseDoubleValue(); return(ret); } catch (UserCancellationException) { throw; } catch (Exception ex) { ErrorParsingField(VRMLReaderError.SFRotationInvalid, ex); } return(null); }
internal override bool ParseNodeBodyElement(string id, VRMLParser parser) { if (id == "autoOffset") { AutoOffset = parser.ParseBoolValue(); } else if (id == "description") { Description = parser.ParseStringValue(); } else if (id == "enabled") { Enabled = parser.ParseBoolValue(); } else if (id == "offset") { Offset = parser.ParseSFRotationValue(); } else { return(false); } return(true); }
public void Visit(SFRotation field) { throw new NotImplementedException(); }
public x3dEspduTransform() { Address = "localhost"; ApplicationID = 1; ArticulationParameterCount = 0; ArticulationParameterDesignatorArray = new List <int>(); ArticulationParameterChangeIndicatorArray = new List <int>(); ArticulationParameterIdPartAttachedToArray = new List <int>(); ArticulationParameterTypeArray = new List <int>(); ArticulationParameterArray = new List <double>(); Center = new SFVec3f(0, 0, 0); Children = new List <X3DChildNode>(); CollisionType = 0; DeadReckoning = 0; DetonationLocation = new SFVec3f(0, 0, 0); DetonationRelativeLocation = new SFVec3f(0, 0, 0); DetonationResult = 0; Enabled = true; EntityCategory = 0; EntityCountry = 0; EntityDomain = 0; EntityExtra = 0; EntityID = 0; EntityKind = 0; EntitySpecific = 0; EntitySubCategory = 0; EventApplicationID = 1; EventEntityID = 0; EventNumber = 0; EventSiteID = 0; Fired1 = false; Fired2 = false; FireMissionIndex = 0; FiringRange = 0.0; FiringRate = 0; ForceID = 0; Fuse = 0; LinearVelocity = new SFVec3f(0, 0, 0); LinearAcceleration = new SFVec3f(0, 0, 0); Marking = ""; MulticastRelayHost = ""; MulticastRelayPort = 0; MunitionApplicationID = 1; MunitionEndPoint = new SFVec3f(0, 0, 0); MunitionEntityID = 0; MunitionQuantity = 0; MunitionSiteID = 0; MunitionStartPoint = new SFVec3f(0, 0, 0); NetworkMode = "standAlone"; Port = 0; ReadInterval = 0.1; Rotation = new SFRotation(0, 0, 1, 0); Scale = new SFVec3f(1, 1, 1); ScaleOrientation = new SFRotation(0, 0, 1, 0); SiteID = 0; Translation = new SFVec3f(0, 0, 0); Warhead = 0; WriteInterval = 1.0; BBoxCenter = new SFVec3f(0, 0, 0); BBoxSize = new SFVec3f(-1, -1, -1); RtpHeaderExpected = false; }