Skip to content

Instantly share code, notes, and snippets.

public static class EntityExtensions
{
public static void LookAt(this Entity e, Vector3 target)
{
float azimuth = GetLookAtAngles(e.Transform.Position, target, out float altitude);
var result = Quaternion.RotationYawPitchRoll(azimuth, -altitude, 0);
e.Transform.Rotation = result;
}
public static Vector3 Position(this Entity e) => e.Transform.Position;
private static float GetLookAtAngles(Vector3 source, Vector3 destination, out float altitude)
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Input;
namespace SomeNameSpace
{
public class CameraFollow : SyncScript
{
public float DelaySpeed = 0.6f;
@w0wca7a
w0wca7a / RainEffect.cs
Last active April 15, 2025 09:04
Gorgeous rain on glass shader for Stride game engine
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
using Stride.Engine;
using Stride.Graphics;
namespace Additionals.Shader.ShadertoyExam
{
[Display("RainDrops effect")]
[ComponentCategory("Effects")]
@w0wca7a
w0wca7a / FollowHeadRotationComponent.cs
Last active April 2, 2025 05:28
Model rotates head towards camera. Basic component realization for Stride game engine. Needs additional rework.
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
// This component must be attached to Entity with Skeleton (Model component with skeleton)
using Stride.Core;
using Stride.Engine;
using Stride.Core.Mathematics;
using Stride.Rendering;
using Stride.Core.Annotations;
@w0wca7a
w0wca7a / SmoothSplineMovementThrowEntity.cs
Last active March 27, 2025 17:26
Advanced movement script, that allow sets Entities(their coordinates) as a spline points in Stride game engine. For cycle motion you may set first point as last in EntityList.
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
using System;
using System.Collections.Generic;
using System.Linq;
using Stride.Core;
using Stride.Core.Annotations;
using Stride.Core.Mathematics;
using Stride.Engine;
@w0wca7a
w0wca7a / CameraShake.cs
Last active April 2, 2025 05:37
Script provides Camera Shaking in Stride Game Engine
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Input;
using System;
using System.Threading;
using System.Threading.Tasks;
@w0wca7a
w0wca7a / TestPopup.cs
Last active March 27, 2025 00:36
Сomponent for Stride Game Engine shows Popup text above entity
using System.Linq;
using Stride.Core;
using Stride.Core.Annotations;
using Stride.Engine;
using Stride.Rendering;
using Stride.Core.Mathematics;
using Stride.UI;
using Stride.UI.Panels;
using Stride.UI.Controls;
using Stride.Graphics;
@w0wca7a
w0wca7a / EllipticalMovementRotateEntity.cs
Last active March 27, 2025 17:04
Движение объекта по эллипсу и вращение относительно оси движения. Motion of an object along an ellipse and rotation about the axis of motion. Script for Stride Game Engine
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
using System;
using Stride.Core.Mathematics;
using Stride.Engine;
[Display("Elliptical Movement with Entity Rotation")]
[ComponentCategory("Movements")]
[DataContract(nameof(EllipticalMovementRotateEntity))]
@w0wca7a
w0wca7a / GalaxyCreator.cs
Last active March 27, 2025 00:37
[WIP] Random galaxies creation in Stride Game Engine. For use, drag and drop script to scene entities list. Add one or more materials to materials list, otherwise generator will be ignored.
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
using System;
using System.Collections.Generic;
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Core;
using Stride.Rendering;
using Stride.Core.Annotations;
// Copyright (c) Stride contributors (https://stride3d.net).
// Distributed under the MIT license.
using System;
using System.Collections.Generic;
using Stride.Core.Mathematics;
using Stride.Rendering;
using Stride.Games;
using Stride.Graphics;
using Buffer = Stride.Graphics.Buffer;