Simple engine for 3d
Features: Collision, dynamic shadow map, bones animation.
Models format: OBJ
, IQE
Unfortunately you will have to use your resources to run the demo
You can edit the scene in the editor. With ObjectEditor
you can save and load the scene state and edit it (see EditorDemo). You can add to the editor your own objects inherited from Node
with custom fields (see DoorNode
).
Added SMP
.package(url: "https://github.com/shsanek/GameSwiftEngine.git", branch: "main")
Added import
import GameSwiftEngine
Create MetalView
let metalView = MetalView()
Added metal view in classic UIView
parentView.addSubview(metalView)
or you can use SwiftUIView
SwiftUIView {
metalView
}
Сreate a SceneNode
and attach it to the loop in you MetalView
let sceneNode = SceneNode()
metalView.controller.node = sceneNode
Use base node for to fill the stage scene
let texture = Texture.load(in: "Asset name")
let object = Sprite3DNode(texture: texture, size: .init(1, 1)) // generate plane
sceneNode.addSubnode(object)
Node
- base nodeSceneNode
- root node for render, contains main cameraSprite3DNode
- simple 3Dmodel node, supported texture and vertex geometryObject3DNode
- 3Dmodel node for IQE (see InterQuakeImporter), supported texture and vertex geometry, and bones animationLightNode
- node for light controllCameraNode
- for render in texture or main camera
NodeAnimation
- animation description, NodeAnimationController
- for control animation
NodeAnimation.empty
NodeAnimation.move
- for change position objectNodeAnimation.updateFrame
- for control transition frame inObject3DNode
NodeAnimation.sequence
- combines multiple animations
var animation = NodeAnimation.move(to: .init(x, y, 0))
animation.duration = 1
controller = container.addAnimation(animation)
For simplicity, there are several functions
perspectiveMatrix
translationMatrix4x4
rotationMatrix4x4