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;
// Copyright (c) Xenko contributors (https://xenko.com) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xenko.Core.Mathematics;
using Xenko.Assets.Presentation.AssetEditors.EntityHierarchyEditor.Game;
using Xenko.Assets.Presentation.AssetEditors.GameEditor;
using Xenko.Assets.Presentation.AssetEditors.GameEditor.Game;
@w0wca7a
w0wca7a / XenkoHeightMapTerrainSnippet.cs
Created January 29, 2025 19:48 — forked from TomGroner/XenkoHeightMapTerrainSnippet.cs
An example of generating terrain using a height map in Xenko, salvaged from a project on a dead hard drive.
using Xenko.Core.Mathematics;
using Xenko.Engine;
using Xenko.Extensions;
using Xenko.Graphics;
using Xenko.Graphics.GeometricPrimitives;
using Xenko.Rendering;
using XenkoTerrain.Extensions;
using System.Collections.Generic;
namespace XenkoTerrain.Graphics
@w0wca7a
w0wca7a / WindowManager.cs
Created January 29, 2025 19:43 — forked from dfkeenan/WindowManager.cs
Xenko Window thingy
using SiliconStudio.Core.Mathematics;
using SiliconStudio.Xenko.Engine;
using SiliconStudio.Xenko.Graphics;
using SiliconStudio.Xenko.UI;
using SiliconStudio.Xenko.UI.Controls;
using SiliconStudio.Xenko.UI.Panels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@w0wca7a
w0wca7a / GameApp.cs
Created November 4, 2024 00:46 — forked from AmbulantRex/GameApp.cs
Autofac DI in Stride
using System.Linq;
using System.Reflection;
using Autofac;
using Autofac.Core;
using Stride.Engine;
namespace GameApp
{
internal static void Main(string[] args)
{
@w0wca7a
w0wca7a / ControllerUIDemo.cs
Created November 4, 2024 00:46 — forked from Aggror/ControllerUIDemo.cs
Stride controller UI navigation
using Stride.Core;
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Input;
using Stride.UI;
using Stride.UI.Controls;
using Stride.UI.Events;
using System;
using System.Collections.Generic;
using System.Linq;
@w0wca7a
w0wca7a / StrideCode.cs
Created October 16, 2024 16:14 — forked from slimshader/StrideCode.cs
Taking .NET game development in Stride Code first demo
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.GameDefaults.ProceduralModels;
using Stride.GameDefaults.Extensions;
using Stride.Physics;
using Stride.Input;
using (var game = new Game())
{
game.Run(start: Start);
@w0wca7a
w0wca7a / StrideExporter.cs
Created October 16, 2024 16:09 — forked from Eideren/StrideExporter.cs
A small class to export/save a scene or a group of entities within a running stride game
namespace Project
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using Stride.Core;
using Stride.Core.Annotations;
using Stride.Core.Mathematics;
using Stride.Core.Yaml;
@w0wca7a
w0wca7a / OutlineScript.cs
Created October 16, 2024 16:06 — forked from EternalTamago/OutlineScript.cs
Xenkoで3Dモデルの輪郭線を描画する
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SiliconStudio.Core.Mathematics;
using SiliconStudio.Xenko.Input;
using SiliconStudio.Xenko.Engine;
using SiliconStudio.Xenko.Rendering;
using SiliconStudio.Xenko.Rendering.Materials;