public static bool SetSeatbeltActive([NotNull] RenderableList parent, bool value) { var changed = false; var onNode = parent.GetDummyByName("CINTURE_ON"); if (onNode != null) { if (onNode.IsEnabled != value) { onNode.IsEnabled = value; changed = true; } } var offNode = parent.GetDummyByName("CINTURE_OFF"); if (offNode != null) { if (offNode.IsEnabled != !value) { offNode.IsEnabled = !value; changed = true; } } return(changed); }
public Wrapper(RenderableList parent, KsAnimEntryBase entry) { _object = parent.GetDummyByName(entry.NodeName); var v2 = entry as KsAnimEntryV2; _frames = v2 != null?ConvertFrames(v2.KeyFrames) : ConvertFrames(((KsAnimEntryV1)entry).Matrices); }
public void Shot(string outputDirectory) { if (!Initialized) { Initialize(); } BackupAndRecycle(outputDirectory); // body shadow PrepareBuffers(BodySize + BodyPadding * 2, 1024); SetBodyShadowCamera(); Draw(BodyMultipler, BodySize, BodyPadding, Fade); // return; SaveResultAs(outputDirectory, "body_shadow.png", BodySize, BodyPadding); // wheels shadows PrepareBuffers(WheelSize + WheelPadding * 2, 128); SetWheelShadowCamera(); _wheelMode = true; var nodes = new[] { "WHEEL_LF", "WHEEL_RF", "WHEEL_LR", "WHEEL_RR" }; foreach (var entry in nodes.Select(x => _carNode.GetDummyByName(x)).NonNull().Select((x, i) => new { Node = x, Matrix = Matrix.Translation(0f, x.Matrix.GetTranslationVector().Y - (x.BoundingBox?.Minimum.Y ?? 0f), 0f), Filename = $"tyre_{i}_shadow.png" })) { _scene.Clear(); _scene.Add(entry.Node); entry.Node.LocalMatrix = entry.Matrix; _scene.UpdateBoundingBox(); Draw(WheelMultipler, WheelSize, WheelPadding, false); SaveResultAs(outputDirectory, entry.Filename, WheelSize, WheelPadding); } }
public Wrapper(RenderableList parent, KsAnimEntryBase entry, bool skipFixed) { _skipFixed = skipFixed; _object = parent.GetDummyByName(entry.NodeName); _frames = entry.GetMatrices(); }