添加3d环境下的摄像机跟随

This commit is contained in:
Leo
2022-01-22 19:30:55 +08:00
parent cf3f1c7880
commit 00c8568bb8
85 changed files with 16575 additions and 0 deletions

24
CameraFollowDemo/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
#///////////////////////////
# Cocos Creator 3D Project
#///////////////////////////
library/
temp/
local/
build/
profiles/
native
#//////////////////////////
# NPM
#//////////////////////////
node_modules/
#//////////////////////////
# VSCode
#//////////////////////////
.vscode/
#//////////////////////////
# WebStorm
#//////////////////////////
.idea/

View File

@@ -0,0 +1,35 @@
# 相机跟随
## 计算目标节点的前向量(世界坐标下)
~~~
节点当前四元数=获取世界坐标系下的旋转()
向向量=向量四元数乘法(节点默认前方向,节点当前四元数)
向向量=向向量.将当前向量归一化()
~~~
## 计算摄像机的向前四元数
~~~
摄像机前向量=摄像机位置-目标节点位置
摄像机节点前向量=摄像机前向量*-1
角度四元数=根据视口的前方向和上方向计算四元数()
摄像机节点角度四元数=角度四元数
~~~
## 计算跟随距离
~~~
CameraPos=TargetPos-TargetForward*hDist+targetUp*vDist;
摄像机位置=目标节点位置-目标节点单位前向量*水平距离+目标节点单位上向量*垂直距离
~~~
## 计算弹簧
~~~
理想位置=计算理想位置函数()
相对差值=实际位置-理想位置
加速度=-1*弹性系数*相对差值-阻尼系数*当前速度
速度=速度+加速度*间隔时间
实际位置=实际位置+速度*间隔时间
~~~
## 参考
* https://mp.weixin.qq.com/s?__biz=MzI1Nzk1MzExNw==&mid=2247485617&idx=1&sn=839880f5200bbf0376f1885c997a791d&chksm=ea0ed483dd795d950cbfe2150fb02a5deece940731ce1e240936c2b69cfc44ecdd53d546bb09&cur_album_id=1342270984425996289&scene=190#rd
* github https://gitee.com/lamyoung/cocos-creator-3d-examples/blob/master/springCamera/assets/src/SpringCamera.ts

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "203d9f6d-0bf0-4206-90e1-08a3b092c7fc",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "bcb14f34-8131-435f-a8f5-29612c45af59",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@@ -0,0 +1,42 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319",
"__expectedType__": "cc.EffectAsset"
},
"_techIdx": 0,
"_defines": [
{},
{},
{}
],
"_states": [
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{},
{}
],
"_props": [
{
"mainColor": {
"__type__": "cc.Color",
"r": 100,
"g": 150,
"b": 255,
"a": 255
}
},
{},
{}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "a0ddabd7-f1da-421f-ac27-bfd6a96339ef",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,34 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "a3cd009f-0ab0-420d-9278-b9fdab939bbc"
},
"_techIdx": 0,
"_defines": [
{
"USE_TEXTURE": true
}
],
"_states": [
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
}
],
"_props": [
{
"mainTexture": {
"__uuid__": "dc4a96c7-321a-48af-81e5-1127ad3ae432@6c48a"
},
"alphaThreshold": 0
}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "482a5162-dad9-446c-b548-8486c7598ee1",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,34 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "a3cd009f-0ab0-420d-9278-b9fdab939bbc"
},
"_techIdx": 0,
"_defines": [
{
"USE_TEXTURE": true
}
],
"_states": [
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
}
],
"_props": [
{
"mainTexture": {
"__uuid__": "4f4c4a34-2d08-4a4d-9169-834d7ce82cee@6c48a"
},
"alphaThreshold": 0
}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "23e988d0-7168-4fe2-9d46-f29c114e9e33",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,42 @@
{
"__type__": "cc.Material",
"_name": "seafloor",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319"
},
"_techIdx": 0,
"_defines": [
{
"USE_ALBEDO_MAP": true
}
],
"_states": [
{
"rasterizerState": {},
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {}
}
],
"_props": [
{
"mainTexture": {
"__uuid__": "0ab3142a-6968-4073-95af-026bc3b23623@2df3a"
},
"albedoScale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"metallic": 0.400000005960464,
"roughness": 0.70710676908493,
"alphaThreshold": 0
}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "70d33758-1c1e-424d-b0ab-eac7410559bf",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,62 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "1baf0fc9-befa-459c-8bdd-af1a450a0319"
},
"_techIdx": 0,
"_defines": [
{
"USE_ALBEDO_MAP": true
},
{
"USE_ALBEDO_MAP": true
},
{
"USE_ALBEDO_MAP": true
}
],
"_states": [
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
}
],
"_props": [
{
"alphaThreshold": 0,
"roughness": 0.70710676908493,
"metallic": 0.400000005960464,
"mainTexture": {
"__uuid__": "95e5b02a-e338-423c-bdbb-17486db1d9eb@6c48a"
}
},
{},
{}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "8e047178-f61c-4322-a2f6-d1adb28b6ae2",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,83 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "a7612b54-35e3-4238-a1a9-4a7b54635839"
},
"_techIdx": 0,
"_defines": [
{
"USE_OUTLINE_PASS": true
},
{
"USE_BASE_COLOR_MAP": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_1": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_2": true
},
{
"USE_BASE_COLOR_MAP": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_1": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_2": true
},
{
"USE_BASE_COLOR_MAP": true
}
],
"_states": [
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
}
],
"_props": [
{},
{
"specular": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 0
},
"mainTexture": {
"__uuid__": "6f891a7b-5a08-48e6-9841-ddb364ac86b1@6c48a"
}
},
{},
{}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "8a58ddec-f437-40b9-8ec0-1fc87de97fb5",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,83 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "a7612b54-35e3-4238-a1a9-4a7b54635839"
},
"_techIdx": 0,
"_defines": [
{
"USE_OUTLINE_PASS": true
},
{
"USE_BASE_COLOR_MAP": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_1": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_2": true
},
{
"USE_BASE_COLOR_MAP": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_1": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_2": true
},
{
"USE_BASE_COLOR_MAP": true
}
],
"_states": [
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
}
],
"_props": [
{},
{
"specular": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 0
},
"mainTexture": {
"__uuid__": "0718d996-39bf-4ab4-bb63-496666fef467@6c48a"
}
},
{},
{}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "a155f93b-7769-4ca4-b75f-b13e52193859",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,83 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "a7612b54-35e3-4238-a1a9-4a7b54635839"
},
"_techIdx": 0,
"_defines": [
{
"USE_OUTLINE_PASS": true
},
{
"USE_BASE_COLOR_MAP": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_1": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_2": true
},
{
"USE_BASE_COLOR_MAP": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_1": true,
"BASE_COLOR_MAP_AS_SHADE_MAP_2": true
},
{
"USE_BASE_COLOR_MAP": true
}
],
"_states": [
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
},
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
}
],
"_props": [
{},
{
"specular": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 0
},
"mainTexture": {
"__uuid__": "c5083e75-ad2e-4ea9-8b33-dee748995b00@6c48a"
}
},
{},
{}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "7bf9df40-4bc9-4e25-8cb0-9a500f949102",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "1ddc11ba-ecbd-4472-841c-f3777cb248da",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "11a1d348-a622-41b2-89f3-ed24657e5f84",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "e00862a8-c500-427c-b76f-bbe5203f19cc",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@@ -0,0 +1,171 @@
{
"ver": "2.1.10",
"importer": "fbx",
"imported": true,
"uuid": "aade09ee-8f9d-413c-a9e8-8c686ea5e160",
"files": [
"__original-animation-0.cconb"
],
"subMetas": {
"ef5e1": {
"importer": "gltf-mesh",
"uuid": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@ef5e1",
"displayName": "",
"id": "ef5e1",
"name": "grass.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
},
"73b7f": {
"importer": "gltf-animation",
"uuid": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@73b7f",
"displayName": "",
"id": "73b7f",
"name": "Take 001.animation",
"ver": "1.0.16",
"imported": true,
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"events": [],
"gltfIndex": 0,
"sample": 30,
"span": {
"from": 0,
"to": 3.3333332538604736
},
"wrapMode": 2,
"speed": 1
}
},
"438fe": {
"importer": "gltf-skeleton",
"uuid": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@438fe",
"displayName": "",
"id": "438fe",
"name": "UnnamedSkeleton.skeleton",
"ver": "1.0.1",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0,
"jointsLength": 6
}
},
"80e0c": {
"importer": "gltf-embeded-image",
"uuid": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@80e0c",
"displayName": "",
"id": "80e0c",
"name": "grass.png.image",
"ver": "1.0.3",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
},
"9787f": {
"importer": "texture",
"uuid": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@9787f",
"displayName": "",
"id": "9787f",
"name": "grass.texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@80e0c"
}
},
"3022b": {
"importer": "gltf-scene",
"uuid": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@3022b",
"displayName": "",
"id": "3022b",
"name": "grass.prefab",
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
}
},
"userData": {
"imageMetas": [
{
"name": "grass.png",
"uri": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@80e0c"
}
],
"animationImportSettings": [
{
"name": "Take 001",
"duration": 3.3333332538604736,
"fps": 30,
"splits": [
{
"name": "Take 001",
"from": 0,
"to": 3.3333332538604736,
"wrapMode": 2
}
]
}
],
"redirect": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@3022b",
"assetFinder": {
"meshes": [
"aade09ee-8f9d-413c-a9e8-8c686ea5e160@ef5e1"
],
"skeletons": [
"aade09ee-8f9d-413c-a9e8-8c686ea5e160@438fe"
],
"textures": [
"aade09ee-8f9d-413c-a9e8-8c686ea5e160@9787f"
],
"materials": [
"b698e55a-b00b-4987-a8b4-af83cddc59f7"
],
"scenes": [
"aade09ee-8f9d-413c-a9e8-8c686ea5e160@3022b"
]
},
"useVertexColors": true,
"dumpMaterials": true,
"materialDumpDir": "db://assets/model/helloWorld/grass",
"legacyFbxImporter": true
}
}

View File

@@ -0,0 +1,34 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "a3cd009f-0ab0-420d-9278-b9fdab939bbc"
},
"_techIdx": 0,
"_defines": [
{
"USE_TEXTURE": true
}
],
"_states": [
{
"blendState": {
"targets": [
{}
]
},
"depthStencilState": {},
"rasterizerState": {}
}
],
"_props": [
{
"mainTexture": {
"__uuid__": "ae18deea-c6e0-4a3d-bf70-ee5533f9ba87@6c48a"
},
"alphaThreshold": 0
}
]
}

View File

@@ -0,0 +1,11 @@
{
"ver": "1.0.11",
"importer": "material",
"imported": true,
"uuid": "b698e55a-b00b-4987-a8b4-af83cddc59f7",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,41 @@
{
"ver": "1.0.22",
"importer": "image",
"imported": true,
"uuid": "ae18deea-c6e0-4a3d-bf70-ee5533f9ba87",
"files": [
".png",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "ae18deea-c6e0-4a3d-bf70-ee5533f9ba87@6c48a",
"displayName": "grass",
"id": "6c48a",
"name": "texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "linear",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "ae18deea-c6e0-4a3d-bf70-ee5533f9ba87"
}
}
},
"userData": {
"type": "texture",
"redirect": "ae18deea-c6e0-4a3d-bf70-ee5533f9ba87@6c48a",
"hasAlpha": false
}
}

View File

@@ -0,0 +1,589 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "grass",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 21
}
],
"_prefab": {
"__id__": 23
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "RootNode",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 8
},
{
"__id__": 14
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 20
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "grass",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0.37992816729770207,
"y": 0.5963678291908521,
"z": 0.5963678291908521,
"w": -0.37992816729770207
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 0.614784121513367,
"y": 0.614784121513367,
"z": 0.614784121513367
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": -90,
"y": -115.0000056286655,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.SkinnedMeshRenderer",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_materials": [
{
"__uuid__": "b698e55a-b00b-4987-a8b4-af83cddc59f7"
}
],
"_visFlags": 0,
"lightmapSettings": {
"__id__": 5
},
"_mesh": {
"__uuid__": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@ef5e1"
},
"_shadowCastingMode": 0,
"_enableMorph": true,
"_skeleton": {
"__uuid__": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@438fe"
},
"_skinningRoot": {
"__id__": 1
},
"_id": "",
"__prefab": {
"__id__": 6
}
},
{
"__type__": "cc.ModelLightmapSettings",
"texture": null,
"uvParam": {
"__type__": "cc.Vec4",
"x": 0,
"y": 0,
"z": 0,
"w": 0
},
"_bakeable": false,
"_castShadow": false,
"_receiveShadow": false,
"_recieveShadow": false,
"_lightmapSize": 64
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "cdq4wvfd1AkYLKBGkpcnul"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "3aIX8gjK5JFK8ATDBKdax8"
},
{
"__type__": "cc.Node",
"_name": "Bone001",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 9
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -0.0461842827498913,
"y": 0.0000118009265861474,
"z": -0.0284814611077309
},
"_lrot": {
"__type__": "cc.Quat",
"x": -0.0000017283479103639154,
"y": -0.000001696768662714476,
"z": 0.7049074170330618,
"w": 0.7092993256770451
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 2.53999996185303,
"y": 2.53999996185303,
"z": 2.53999996185303
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": -0.0005507418826256091,
"y": 0.00027320859410338513,
"z": 89.64412979694991
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Bone002",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [
{
"__id__": 10
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 12
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0.0404664427042007,
"y": -3.57627860658738e-9,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0.000002421418716486127,
"y": 1.5182564735607207e-8,
"z": 0.006269989150778519,
"w": 0.9999803434219023
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0.000277479600078167,
"y": -3.18993241527229e-13,
"z": 0.7184925395739944
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Bone003",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 11
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0.0397140197455883,
"y": -1.19209286886246e-9,
"z": 7.15255721317476e-9
},
"_lrot": {
"__type__": "cc.Quat",
"x": 1.4018830392883508e-10,
"y": -1.4662893682703937e-13,
"z": -0.0010459420626472054,
"w": 0.9999994530024512
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 1.606440509162768e-8,
"y": -1.4726229276075984e-18,
"z": -0.11985615346346049
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "1628kgL41EG4kfuuNtniX1"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "d1mgL13wtIwojR/2FqCufO"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "f5o8/2y99IcawmyX5Tnjyv"
},
{
"__type__": "cc.Node",
"_name": "Bone004",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 15
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 19
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0.0710692703723907,
"y": 0.0000118009265861474,
"z": 0.0136896027252078
},
"_lrot": {
"__type__": "cc.Quat",
"x": -0.0000017283479103639154,
"y": -0.000001696768662714476,
"z": 0.7049074170330618,
"w": 0.7092993256770451
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 2.53999996185303,
"y": 2.53999996185303,
"z": 2.53999996185303
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": -0.0005507418826256091,
"y": 0.00027320859410338513,
"z": 89.64412979694991
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Bone005",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 16
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 18
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0.0404664427042007,
"y": -4.76837147544984e-9,
"z": 5.9604643443123e-10
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0.000002421418716486127,
"y": 1.5182564735607207e-8,
"z": 0.006269989150778519,
"w": 0.9999803434219023
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0.000277479600078167,
"y": -3.18993241527229e-13,
"z": 0.7184925395739944
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Bone006",
"_objFlags": 0,
"_parent": {
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 17
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0.039714016020298,
"y": 0,
"z": 7.74860353658369e-9
},
"_lrot": {
"__type__": "cc.Quat",
"x": 1.4018830392883508e-10,
"y": -1.4662893682703937e-13,
"z": -0.0010459420626472054,
"w": 0.9999994530024512
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 1.606440509162768e-8,
"y": -1.4726229276075984e-18,
"z": -0.11985615346346049
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "a2tndvTm9M84i3qPpLv8DA"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c5xVHa1qBClrp5YbutRSaI"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "3fxCLd4O9NUqkwJjBsDQgb"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b7w6U8zppFX54UJURtAWiT"
},
{
"__type__": "cc.SkeletalAnimation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"playOnLoad": false,
"_clips": [
{
"__uuid__": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@73b7f"
}
],
"_defaultClip": {
"__uuid__": "aade09ee-8f9d-413c-a9e8-8c686ea5e160@73b7f"
},
"_useBakedAnimation": true,
"_sockets": [],
"_id": "",
"__prefab": {
"__id__": 22
}
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "deki0q/OJHD4jsTyP928BZ"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "fdSk3ayLBOH7saksB95r+y"
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.35",
"importer": "prefab",
"imported": true,
"uuid": "ebe68402-4803-40d3-b0a2-ca696e3f7c60",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "grass"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.35",
"importer": "prefab",
"imported": true,
"uuid": "5e4d48c4-0e34-45af-a268-89485197e8bc",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "grassGoup"
}
}

Binary file not shown.

View File

@@ -0,0 +1,110 @@
{
"ver": "2.1.10",
"importer": "fbx",
"imported": true,
"uuid": "929e58ce-66a4-4e04-9036-4244456a1220",
"files": [],
"subMetas": {
"f6832": {
"importer": "gltf-mesh",
"uuid": "929e58ce-66a4-4e04-9036-4244456a1220@f6832",
"displayName": "",
"id": "f6832",
"name": "hdcSky.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
},
"7f40d": {
"importer": "gltf-embeded-image",
"uuid": "929e58ce-66a4-4e04-9036-4244456a1220@7f40d",
"displayName": "",
"id": "7f40d",
"name": "hdcSky.image",
"ver": "1.0.3",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
},
"d6067": {
"importer": "texture",
"uuid": "929e58ce-66a4-4e04-9036-4244456a1220@d6067",
"displayName": "",
"id": "d6067",
"name": "hdcSky.texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "929e58ce-66a4-4e04-9036-4244456a1220@7f40d"
}
},
"bfc57": {
"importer": "gltf-scene",
"uuid": "929e58ce-66a4-4e04-9036-4244456a1220@bfc57",
"displayName": "",
"id": "bfc57",
"name": "hdcSky.prefab",
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
}
},
"userData": {
"imageMetas": [
{
"name": "hdcSky",
"uri": "929e58ce-66a4-4e04-9036-4244456a1220@7f40d"
}
],
"redirect": "929e58ce-66a4-4e04-9036-4244456a1220@bfc57",
"assetFinder": {
"meshes": [
"929e58ce-66a4-4e04-9036-4244456a1220@f6832"
],
"skeletons": [],
"textures": [
"929e58ce-66a4-4e04-9036-4244456a1220@d6067"
],
"materials": [
"482a5162-dad9-446c-b548-8486c7598ee1"
],
"scenes": [
"929e58ce-66a4-4e04-9036-4244456a1220@bfc57"
]
},
"dumpMaterials": true,
"materialDumpDir": "db://assets/material",
"legacyFbxImporter": true
}
}

View File

@@ -0,0 +1,223 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "hdcSky",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 9
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "RootNode",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 8
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "hdcSky",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0.00000556361783310422
},
"_lrot": {
"__type__": "cc.Quat",
"x": -0.7071067811865476,
"y": 0,
"z": 0,
"w": 0.7071067811865476
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 2.57702493667603,
"y": 2.57702493667603,
"z": 2.57702493667603
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": -90.00000000000003,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.MeshRenderer",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_materials": [
{
"__uuid__": "482a5162-dad9-446c-b548-8486c7598ee1"
}
],
"_visFlags": 0,
"lightmapSettings": {
"__id__": 5
},
"_mesh": {
"__uuid__": "929e58ce-66a4-4e04-9036-4244456a1220@f6832"
},
"_shadowCastingMode": 0,
"_enableMorph": true,
"_id": "",
"__prefab": {
"__id__": 6
}
},
{
"__type__": "cc.ModelLightmapSettings",
"texture": null,
"uvParam": {
"__type__": "cc.Vec4",
"x": 0,
"y": 0,
"z": 0,
"w": 0
},
"_bakeable": false,
"_castShadow": false,
"_receiveShadow": false,
"_recieveShadow": false,
"_lightmapSize": 64
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "faUTUMvuxGGLzyygmsEygr"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "537wfATPdERIxNoHyImaal"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "68pBvn4L5LzqzYlxlqIh1Z"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "a0C8RfybZDJbzD2rhAA/j8"
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.35",
"importer": "prefab",
"imported": true,
"uuid": "f0512d7a-e4f6-4209-8dc0-ed1de7149c85",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "hdcSky"
}
}

Binary file not shown.

View File

@@ -0,0 +1,366 @@
{
"ver": "2.1.10",
"importer": "fbx",
"imported": true,
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623",
"files": [],
"subMetas": {
"71919": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@71919",
"displayName": "",
"id": "71919",
"name": "tree1-6.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 6
}
},
"2b0a8": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@2b0a8",
"displayName": "",
"id": "2b0a8",
"name": "plane01-0.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
},
"4a7d8": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@4a7d8",
"displayName": "",
"id": "4a7d8",
"name": "stone1-1.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 1
}
},
"0e750": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@0e750",
"displayName": "",
"id": "0e750",
"name": "tree1-2.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 2
}
},
"ef86b": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@ef86b",
"displayName": "",
"id": "ef86b",
"name": "tree1-3.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 3
}
},
"426f2": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@426f2",
"displayName": "",
"id": "426f2",
"name": "tree1-4.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 4
}
},
"754a2": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@754a2",
"displayName": "",
"id": "754a2",
"name": "tree1-5.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 5
}
},
"1332c": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@1332c",
"displayName": "",
"id": "1332c",
"name": "tree1-7.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 7
}
},
"4d16f": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@4d16f",
"displayName": "",
"id": "4d16f",
"name": "tree1-8.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 8
}
},
"efe84": {
"importer": "gltf-mesh",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@efe84",
"displayName": "",
"id": "efe84",
"name": "tree1-9.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 9
}
},
"baeab": {
"importer": "gltf-embeded-image",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@baeab",
"displayName": "",
"id": "baeab",
"name": "seafloor.jpg.image",
"ver": "1.0.3",
"imported": true,
"files": [
".jpg",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
},
"eeccb": {
"importer": "gltf-embeded-image",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@eeccb",
"displayName": "",
"id": "eeccb",
"name": "stone.jpg.image",
"userData": {
"gltfIndex": 1
},
"ver": "1.0.3",
"imported": true,
"files": [
".jpg",
".json"
],
"subMetas": {}
},
"3b6f8": {
"importer": "gltf-embeded-image",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@3b6f8",
"displayName": "",
"id": "3b6f8",
"name": "tree.png.image",
"userData": {
"gltfIndex": 2
},
"ver": "1.0.3",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {}
},
"2df3a": {
"importer": "texture",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@2df3a",
"displayName": "",
"id": "2df3a",
"name": "seafloor.texture",
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "0ab3142a-6968-4073-95af-026bc3b23623@baeab"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"91a84": {
"importer": "texture",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@91a84",
"displayName": "",
"id": "91a84",
"name": "stone.texture",
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "0ab3142a-6968-4073-95af-026bc3b23623@eeccb"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"0595c": {
"importer": "texture",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@0595c",
"displayName": "",
"id": "0595c",
"name": "tree.texture",
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "0ab3142a-6968-4073-95af-026bc3b23623@3b6f8"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"cc8e5": {
"importer": "gltf-scene",
"uuid": "0ab3142a-6968-4073-95af-026bc3b23623@cc8e5",
"displayName": "",
"id": "cc8e5",
"name": "islands.prefab",
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
}
},
"userData": {
"imageMetas": [
{
"name": "seafloor.jpg",
"uri": "0ab3142a-6968-4073-95af-026bc3b23623@baeab"
},
{
"name": "stone.jpg",
"uri": "0ab3142a-6968-4073-95af-026bc3b23623@eeccb"
},
{
"name": "tree.png",
"uri": "0ab3142a-6968-4073-95af-026bc3b23623@3b6f8"
}
],
"redirect": "0ab3142a-6968-4073-95af-026bc3b23623@cc8e5",
"assetFinder": {
"meshes": [
"0ab3142a-6968-4073-95af-026bc3b23623@2b0a8",
"0ab3142a-6968-4073-95af-026bc3b23623@4a7d8",
"0ab3142a-6968-4073-95af-026bc3b23623@0e750",
"0ab3142a-6968-4073-95af-026bc3b23623@ef86b",
"0ab3142a-6968-4073-95af-026bc3b23623@426f2",
"0ab3142a-6968-4073-95af-026bc3b23623@754a2",
"0ab3142a-6968-4073-95af-026bc3b23623@71919",
"0ab3142a-6968-4073-95af-026bc3b23623@1332c",
"0ab3142a-6968-4073-95af-026bc3b23623@4d16f",
"0ab3142a-6968-4073-95af-026bc3b23623@efe84"
],
"skeletons": [],
"textures": [
"0ab3142a-6968-4073-95af-026bc3b23623@2df3a",
"0ab3142a-6968-4073-95af-026bc3b23623@91a84",
"0ab3142a-6968-4073-95af-026bc3b23623@0595c"
],
"materials": [
"70d33758-1c1e-424d-b0ab-eac7410559bf",
"a155f93b-7769-4ca4-b75f-b13e52193859",
"7bf9df40-4bc9-4e25-8cb0-9a500f949102"
],
"scenes": [
"0ab3142a-6968-4073-95af-026bc3b23623@cc8e5"
]
},
"dumpMaterials": true,
"materialDumpDir": "db://assets/material",
"legacyFbxImporter": true
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.35",
"importer": "prefab",
"imported": true,
"uuid": "ccc3a755-7d3d-4304-aa3b-ca4792d79d9f",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "islands"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB

View File

@@ -0,0 +1,41 @@
{
"ver": "1.0.22",
"importer": "image",
"imported": true,
"uuid": "4f4c4a34-2d08-4a4d-9169-834d7ce82cee",
"files": [
".jpg",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "4f4c4a34-2d08-4a4d-9169-834d7ce82cee@6c48a",
"displayName": "seafloor",
"id": "6c48a",
"name": "texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "4f4c4a34-2d08-4a4d-9169-834d7ce82cee"
}
}
},
"userData": {
"type": "texture",
"redirect": "4f4c4a34-2d08-4a4d-9169-834d7ce82cee@6c48a",
"hasAlpha": false
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,41 @@
{
"ver": "1.0.22",
"importer": "image",
"imported": true,
"uuid": "95e5b02a-e338-423c-bdbb-17486db1d9eb",
"files": [
".jpg",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "95e5b02a-e338-423c-bdbb-17486db1d9eb@6c48a",
"displayName": "shield",
"id": "6c48a",
"name": "texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "95e5b02a-e338-423c-bdbb-17486db1d9eb"
}
}
},
"userData": {
"type": "texture",
"redirect": "95e5b02a-e338-423c-bdbb-17486db1d9eb@6c48a",
"hasAlpha": false
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 KiB

View File

@@ -0,0 +1,41 @@
{
"ver": "1.0.22",
"importer": "image",
"imported": true,
"uuid": "dc4a96c7-321a-48af-81e5-1127ad3ae432",
"files": [
".png",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "dc4a96c7-321a-48af-81e5-1127ad3ae432@6c48a",
"displayName": "sky",
"id": "6c48a",
"name": "texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "dc4a96c7-321a-48af-81e5-1127ad3ae432"
}
}
},
"userData": {
"type": "texture",
"redirect": "dc4a96c7-321a-48af-81e5-1127ad3ae432@6c48a",
"hasAlpha": false
}
}

Binary file not shown.

View File

@@ -0,0 +1,308 @@
{
"ver": "2.1.10",
"importer": "fbx",
"imported": true,
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289",
"files": [
"__original-animation-0.cconb"
],
"subMetas": {
"18751": {
"importer": "gltf-mesh",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@18751",
"displayName": "",
"id": "18751",
"name": "soldier.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
},
"30732": {
"importer": "gltf-skeleton",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@30732",
"displayName": "",
"id": "30732",
"name": "UnnamedSkeleton-0.skeleton",
"ver": "1.0.1",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0,
"jointsLength": 22
}
},
"da6f3": {
"importer": "gltf-mesh",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@da6f3",
"displayName": "",
"id": "da6f3",
"name": "shield.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 1
}
},
"4b929": {
"importer": "gltf-mesh",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@4b929",
"displayName": "",
"id": "4b929",
"name": "sword.mesh",
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 2
}
},
"39f7b": {
"importer": "gltf-mesh",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@39f7b",
"displayName": "",
"id": "39f7b",
"name": "shield01.mesh",
"userData": {
"gltfIndex": 3
},
"ver": "1.1.0",
"imported": true,
"files": [
".bin",
".json"
],
"subMetas": {}
},
"73b7f": {
"importer": "gltf-animation",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@73b7f",
"displayName": "",
"id": "73b7f",
"name": "Take 001.animation",
"ver": "1.0.16",
"imported": true,
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"events": [],
"gltfIndex": 0,
"sample": 30,
"span": {
"from": 0.03333333333333333,
"to": 1.3333333730697632
},
"wrapMode": 2,
"speed": 1
}
},
"f1394": {
"importer": "gltf-skeleton",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@f1394",
"displayName": "",
"id": "f1394",
"name": "UnnamedSkeleton-1.skeleton",
"ver": "1.0.1",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 1,
"jointsLength": 1
}
},
"75ee4": {
"importer": "gltf-skeleton",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@75ee4",
"displayName": "",
"id": "75ee4",
"name": "UnnamedSkeleton-2.skeleton",
"ver": "1.0.1",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 2,
"jointsLength": 1
}
},
"a72ab": {
"importer": "gltf-skeleton",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@a72ab",
"displayName": "",
"id": "a72ab",
"name": "UnnamedSkeleton-3.skeleton",
"ver": "1.0.1",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 3,
"jointsLength": 1
}
},
"e94f1": {
"importer": "gltf-embeded-image",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@e94f1",
"displayName": "",
"id": "e94f1",
"name": "shield.jpg.image",
"userData": {
"gltfIndex": 1
},
"ver": "1.0.3",
"imported": true,
"files": [
".jpg",
".json"
],
"subMetas": {}
},
"f3caa": {
"importer": "texture",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@f3caa",
"displayName": "",
"id": "f3caa",
"name": "soldier.texture",
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": false,
"imageUuidOrDatabaseUri": "db://assets/model/helloWorld/soldier.png"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"a2be1": {
"importer": "texture",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@a2be1",
"displayName": "",
"id": "a2be1",
"name": "shield.texture",
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "e3553cad-2f15-4293-859a-8f43c780f289@e94f1"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"d252c": {
"importer": "gltf-scene",
"uuid": "e3553cad-2f15-4293-859a-8f43c780f289@d252c",
"displayName": "",
"id": "d252c",
"name": "soldier.prefab",
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"gltfIndex": 0
}
}
},
"userData": {
"imageMetas": [
{
"name": "soldier",
"uri": "db://assets/model/helloWorld/soldier.png"
},
{
"name": "shield.jpg",
"uri": "e3553cad-2f15-4293-859a-8f43c780f289@e94f1"
}
],
"redirect": "e3553cad-2f15-4293-859a-8f43c780f289@d252c",
"assetFinder": {
"meshes": [
"e3553cad-2f15-4293-859a-8f43c780f289@18751",
"e3553cad-2f15-4293-859a-8f43c780f289@da6f3",
"e3553cad-2f15-4293-859a-8f43c780f289@4b929",
"e3553cad-2f15-4293-859a-8f43c780f289@39f7b"
],
"skeletons": [
"e3553cad-2f15-4293-859a-8f43c780f289@30732",
"e3553cad-2f15-4293-859a-8f43c780f289@f1394",
"e3553cad-2f15-4293-859a-8f43c780f289@75ee4",
"e3553cad-2f15-4293-859a-8f43c780f289@a72ab"
],
"textures": [
"e3553cad-2f15-4293-859a-8f43c780f289@f3caa",
"e3553cad-2f15-4293-859a-8f43c780f289@a2be1"
],
"materials": [
"8a58ddec-f437-40b9-8ec0-1fc87de97fb5",
"8e047178-f61c-4322-a2f6-d1adb28b6ae2"
],
"scenes": [
"e3553cad-2f15-4293-859a-8f43c780f289@d252c"
]
},
"dumpMaterials": true,
"materialDumpDir": "db://assets/material",
"animationImportSettings": [
{
"name": "Take 001",
"duration": 1.3333333730697632,
"fps": 30,
"splits": [
{
"name": "Take 001",
"from": 0.03333333333333333,
"to": 1.3333333730697632,
"wrapMode": 2
}
]
}
],
"legacyFbxImporter": true
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

View File

@@ -0,0 +1,41 @@
{
"ver": "1.0.22",
"importer": "image",
"imported": true,
"uuid": "6f891a7b-5a08-48e6-9841-ddb364ac86b1",
"files": [
".png",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "6f891a7b-5a08-48e6-9841-ddb364ac86b1@6c48a",
"displayName": "soldier",
"id": "6c48a",
"name": "texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "6f891a7b-5a08-48e6-9841-ddb364ac86b1"
}
}
},
"userData": {
"type": "texture",
"redirect": "6f891a7b-5a08-48e6-9841-ddb364ac86b1@6c48a",
"hasAlpha": true
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.35",
"importer": "prefab",
"imported": true,
"uuid": "cfc53c4e-7956-482b-aebc-3fb1dcd36eef",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "soldier"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View File

@@ -0,0 +1,41 @@
{
"ver": "1.0.22",
"importer": "image",
"imported": true,
"uuid": "0718d996-39bf-4ab4-bb63-496666fef467",
"files": [
".jpg",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "0718d996-39bf-4ab4-bb63-496666fef467@6c48a",
"displayName": "stone",
"id": "6c48a",
"name": "texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "0718d996-39bf-4ab4-bb63-496666fef467"
}
}
},
"userData": {
"type": "texture",
"redirect": "0718d996-39bf-4ab4-bb63-496666fef467@6c48a",
"hasAlpha": false
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

View File

@@ -0,0 +1,41 @@
{
"ver": "1.0.22",
"importer": "image",
"imported": true,
"uuid": "c5083e75-ad2e-4ea9-8b33-dee748995b00",
"files": [
".png",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "c5083e75-ad2e-4ea9-8b33-dee748995b00@6c48a",
"displayName": "tree",
"id": "6c48a",
"name": "texture",
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "c5083e75-ad2e-4ea9-8b33-dee748995b00"
}
}
},
"userData": {
"type": "texture",
"redirect": "c5083e75-ad2e-4ea9-8b33-dee748995b00@6c48a",
"hasAlpha": false
}
}

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "b0a4abb1-db32-49c3-9e09-a45b922a2094",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
{
"ver": "1.1.35",
"importer": "scene",
"imported": true,
"uuid": "7c3e7fab-7b1e-4865-ba84-3cf81b48b9fb",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "fd940988-b5a4-4d7e-a23c-182c215fa8cb",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@@ -0,0 +1,91 @@
import { _decorator, Component, Node, Vec3, v3, Quat, Enum } from 'cc';
import { NHelper } from './NHelper';
const { ccclass, property } = _decorator;
export enum ECameraState {
/**不跟随 */
idle,
/**跟随 */
look,
}
@ccclass('CameraFollow')
export class CameraFollow extends Component {
@property({ type: Node, displayName: "跟随目标" })
protected target: Node = null;
@property({ type: Enum(ECameraState), displayName: "跟随状态" })
protected state: ECameraState = ECameraState.look;
@property({ displayName: "水平跟随距离" })
protected hDist: number = 5;
@property({ displayName: "垂直跟随距离" })
protected vDist: number = 4;
private tempPos: Vec3 = v3();
start() {
}
/**
* 计算前向量
* @returns
*/
protected getUp() {
return v3(0, 1, 0);
}
/**
* 计算跟随距离
* @returns
*/
protected computeCameraPos(out: Vec3 = null): Vec3 {
let tempPos = out ? out : this.tempPos;
this.target.getWorldPosition(tempPos);
let forward = NHelper.getForward(this.target);
forward.multiplyScalar(-this.hDist);
tempPos.add(forward);
tempPos.add(this.getUp().multiplyScalar(this.vDist));
return tempPos;
}
/**
* 跟随
* @param dt
*/
protected lookAt(dt: number) {
let pos = this.computeCameraPos();
this.updatePosition(pos);
this.updateRotation(pos);
}
/**
* 更新跟随位置
* @param pos
*/
protected updatePosition(pos: Vec3) {
this.node.worldPosition = pos;
}
/**
* 更新角度四元数
* @param pos
*/
protected updateRotation(pos: Vec3) {
//camera前方向
let forward = this.target.position.clone().subtract(pos);
//取反得到camera节点的前方向
forward.multiplyScalar(-1).normalize();
//构造四元数
let quat = new Quat();
Quat.fromViewUp(quat, forward, this.getUp());
this.node.setRotation(quat);
}
update(deltaTime: number) {
if (this.state == ECameraState.look) {
this.lookAt(deltaTime);
}
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "96df90e9-217e-4c3a-a4cd-02ed0ffb48a4",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,79 @@
import { _decorator, Component, Node, input, Input, EventKeyboard, KeyCode, game } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('InputManager')
export class InputManager extends Component {
// [1]
// dummy = '';
// [2]
// @property
// serializableDummy = 0;
onLoad() {
}
start() {
}
onEnable() {
input.on(Input.EventType.KEY_DOWN, this.onKeyDown, this);
input.on(Input.EventType.KEY_UP, this.onKeyUp, this);
}
onDisable() {
input.off(Input.EventType.KEY_DOWN, this.onKeyDown, this);
input.off(Input.EventType.KEY_UP, this.onKeyUp, this);
}
onKeyDown(event: EventKeyboard) {
switch (event.keyCode) {
case KeyCode.KEY_A: {
console.log('key a');
//left
game.emit("rule_horizontal_push", 1)
} break;
case KeyCode.KEY_D: {
console.log('key d');
game.emit("rule_horizontal_push", -1)
} break;
case KeyCode.KEY_W: {
game.emit("rule_vertical_push", 1)
} break;
case KeyCode.KEY_S: {
game.emit("rule_vertical_push", -1)
} break;
}
}
onKeyUp(event: EventKeyboard) {
switch (event.keyCode) {
case KeyCode.KEY_A: {
console.log('key a');
//left
game.emit("rule_horizontal_push", 0)
} break;
case KeyCode.KEY_D: {
console.log('key d');
game.emit("rule_horizontal_push", 0)
} break;
case KeyCode.KEY_W: {
game.emit("rule_vertical_push", 0)
} break;
case KeyCode.KEY_S: {
game.emit("rule_vertical_push", 0)
} break;
}
}
// update(deltaTime: number) {
// }
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "4573374e-825b-4f65-8df0-65c6a72475d3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,31 @@
import { _decorator, Component, Node, v3 } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('LookAt')
export class LookAt extends Component {
@property(Node)
target: Node = null;
start() {
// [3]
}
update(deltaTime: number) {
// [4]
this.node.lookAt(this.target.worldPosition,v3(0,1,0));
}
}
/**
* [1] Class member could be defined like this.
* [2] Use `property` decorator if your want the member to be serializable.
* [3] Your initialization goes here.
* [4] Your update function goes here.
*
* Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
* Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/ccclass.html
* Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
*/

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "3d2b16f4-afa5-42eb-9966-23d96ab87be3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,16 @@
import { CCObject, Node, Quat, v3, Vec3 } from "cc";
export class NHelper {
private static tempQuat: Quat = new Quat();
private static tempPos:Vec3=new Vec3();
/**
* 计算节点世界坐标下的向前向量
* @param node 目标节点
* @param defaultForward 默认前方向
*/
public static getForward(node: Node, defaultForward: Vec3 = v3(0, 0, 1)) {
node.getWorldRotation(this.tempQuat);
Vec3.transformQuat(this.tempPos, defaultForward, this.tempQuat);
return this.tempPos.normalize();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "8ba48c76-b830-4db2-b387-7aeec8d76a10",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,71 @@
import { _decorator, Component, Node, game, Quat, v3, Vec3 } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('Role')
export class Role extends Component {
@property(Node)
target: Node = null;
private speed: number = 10;
private angleSpeed: number = 4;
onEnable() {
game.on("rule_horizontal_push", this.onMoveHorizontal, this);
game.on("rule_vertical_push", this.onMoveVertical, this);
console.log('forward=',this.getForward());
}
onDisable() {
game.off("rule_horizontal_push", this.onMoveHorizontal, this);
game.off("rule_vertical_push", this.onMoveVertical, this);
}
/**
*
* @returns
*/
getForward() {
let rotation = this.target.getWorldRotation();
let forward=v3();
//通过角色的角度的四元数,取得前进向量
Vec3.transformQuat(forward,v3(0,0,1),rotation);
return forward.normalize();
}
private hDir: number = 0;
onMoveHorizontal() {
this.hDir = arguments[0];
}
private rotation(dt: number) {
let rotation = this.target.worldRotation;
let next = new Quat();
Quat.rotateAround(next, rotation, v3(0, 1, 0), this.angleSpeed * dt * this.hDir);
this.target.setRotation(next);
}
private vDir: number = 0;
onMoveVertical() {
this.vDir = arguments[0];
}
move(dt: number) {
let forward = this.getForward();
forward.multiplyScalar(this.speed * dt * this.vDir);
let pos = this.target.getWorldPosition().add(forward);
this.target.setWorldPosition(pos);
}
update(deltaTime: number) {
if (Math.abs(this.vDir) > 0) {
this.move(deltaTime);
}
if (Math.abs(this.hDir) > 0) {
this.rotation(deltaTime);
}
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "44808a8f-99b0-441b-aa1d-7aebc1ee9ac6",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,42 @@
import { _decorator, Component, Node, Vec3, v3 } from 'cc';
import { CameraFollow } from './CameraFollow';
const { ccclass, property } = _decorator;
@ccclass('SpringCamera')
export class SpringCamera extends CameraFollow {
@property({ displayName: "弹性系数", tooltip: "数值越高表示越僵硬" })
protected springConst: number = 1000;
/**阻尼系数,数值是由弹性系数决定 */
protected dampeConst: number = 1;
/**移动速度*/
protected velocity: Vec3 = v3();
/**camera真实位置向量*/
protected actualPos: Vec3 = v3();
/**理想位置到真实位置的差值 */
private diff: Vec3 = v3();
/**弹簧加速度 */
private springAcc: Vec3 = v3();
onLoad() {
this.dampeConst = 2 * Math.sqrt(this.springConst);
//起初,设置位置为理想位置,就是基础跟随摄像机的眼睛位置一样
this.computeCameraPos(this.actualPos);
this.updatePosition(this.actualPos);
this.updateRotation(this.actualPos);
}
protected lookAt(dt: number) {
let idealPos = this.computeCameraPos();
//差值
Vec3.subtract(this.diff, this.actualPos, idealPos);
//计算加速度
Vec3.subtract(this.springAcc, this.diff.multiplyScalar(-1 * this.dampeConst), this.velocity.clone().multiplyScalar(this.dampeConst));
this.velocity.add(this.springAcc.multiplyScalar(dt));
this.actualPos.add(this.velocity.multiplyScalar(dt));
//更新位置跟角度
this.updatePosition(this.actualPos);
this.updateRotation(this.actualPos);
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "def1b9e4-d41e-4626-b9fb-2e665c0cb254",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "9e344b1f-8681-4ddf-bcc6-bb014c332bb8",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 KiB

View File

@@ -0,0 +1,131 @@
{
"ver": "1.0.22",
"importer": "image",
"imported": true,
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb",
"files": [
".jpg",
".json"
],
"subMetas": {
"b47c0": {
"importer": "erp-texture-cube",
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0",
"displayName": "sunnySkyBox",
"id": "b47c0",
"name": "textureCube",
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "linear",
"anisotropy": 1,
"isRGBE": false,
"imageDatabaseUri": "db://assets/skybox/sunnySkyBox.jpg"
},
"ver": "1.0.10",
"imported": true,
"files": [
".json"
],
"subMetas": {
"e9a6d": {
"importer": "texture-cube-face",
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@e9a6d",
"displayName": "",
"id": "e9a6d",
"name": "front",
"userData": {},
"ver": "1.0.0",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {}
},
"40c10": {
"importer": "texture-cube-face",
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@40c10",
"displayName": "",
"id": "40c10",
"name": "back",
"userData": {},
"ver": "1.0.0",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {}
},
"bb97f": {
"importer": "texture-cube-face",
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@bb97f",
"displayName": "",
"id": "bb97f",
"name": "top",
"userData": {},
"ver": "1.0.0",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {}
},
"7d38f": {
"importer": "texture-cube-face",
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@7d38f",
"displayName": "",
"id": "7d38f",
"name": "bottom",
"userData": {},
"ver": "1.0.0",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {}
},
"74afd": {
"importer": "texture-cube-face",
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@74afd",
"displayName": "",
"id": "74afd",
"name": "right",
"userData": {},
"ver": "1.0.0",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {}
},
"8fd34": {
"importer": "texture-cube-face",
"uuid": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0@8fd34",
"displayName": "",
"id": "8fd34",
"name": "left",
"userData": {},
"ver": "1.0.0",
"imported": true,
"files": [
".png",
".json"
],
"subMetas": {}
}
}
}
},
"userData": {
"hasAlpha": false,
"type": "texture cube",
"redirect": "5af201b5-5951-4e2c-a81f-ac4aad9132cb@b47c0"
}
}

View File

@@ -0,0 +1,9 @@
{
"name": "CameraFollowDemo",
"type": "3d",
"uuid": "c30b28da-749e-479b-bcb6-cecd8d7be9e3",
"version": "3.4.0",
"creator": {
"version": "3.4.0"
}
}

View File

@@ -0,0 +1,3 @@
{
"__version__": "1.2.4"
}

View File

@@ -0,0 +1,18 @@
{
"modules": {
"cache": {},
"includeModules": [
"base",
"gfx-webgl",
"gfx-webgl2",
"ui",
"particle",
"physics-cannon",
"physics-framework",
"audio",
"tween",
"terrain"
]
},
"__version__": "1.0.1"
}

View File

@@ -0,0 +1,7 @@
{
"__version__": "1.0.1",
"script": {
"useDefineForClassFields": false,
"allowDeclareFields": false
}
}

View File

@@ -0,0 +1,3 @@
{
"__version__": "1.3.0"
}

View File

@@ -0,0 +1,30 @@
{
"modules": {
"cache": {},
"includeModules": [
"base",
"gfx-webgl",
"gfx-webgl2",
"3d",
"2d",
"ui",
"particle",
"physics-ammo",
"physics-2d-box2d",
"intersection-2d",
"primitive",
"profiler",
"particle-2d",
"audio",
"video",
"webview",
"tween",
"terrain",
"tiled-map",
"spine",
"dragon-bones",
"marionette"
]
},
"__version__": "1.0.5"
}

View File

@@ -0,0 +1,7 @@
{
"__version__": "1.0.1",
"script": {
"useDefineForClassFields": false,
"allowDeclareFields": false
}
}

View File

@@ -0,0 +1,9 @@
{
/* Base configuration. Do not edit this field. */
"extends": "./temp/tsconfig.cocos.json",
/* Add your custom configuration here. */
"compilerOptions": {
"strict": false
}
}

View File

@@ -0,0 +1,22 @@
{
"game": {
"name": "未知游戏",
"app_id": "UNKNOW",
"c_id": "0"
},
"appConfigMaps": [
{
"app_id": "UNKNOW",
"config_id": "8a3a56"
}
],
"configs": [
{
"app_id": "UNKNOW",
"config_id": "8a3a56",
"config_name": "Default",
"config_remarks": "",
"services": []
}
]
}