Commit ada86753 authored by Master Q's avatar Master Q

模型替换

parent 0a527e6e
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,7 +5,7 @@
"name": "UI"
},
{
"keys": "luntai.gltf,qiche_V6.gltf,shamo_V10.gltf",
"keys": "luntai.gltf,qiche_V6.gltf,shamo_V10.gltf,shamo_V14_L(1).gltf",
"name": "gltf"
},
{
......
......@@ -497,7 +497,7 @@ export class CarScene extends PerspectiveScene {
scene: THREE.Scene,
}
const ins: GltfModel = RES.getRes('shamo_V10.gltf')
const ins: GltfModel = RES.getRes('shamo_V14_L(1).gltf')
let terrainMesh: THREE.Mesh
this.scene.add(ins.scene)
......@@ -515,8 +515,9 @@ export class CarScene extends PerspectiveScene {
))
} else if (obj.name === 'shamo' && (obj as THREE.Mesh).isMesh) {
terrainMesh = obj as THREE.Mesh
} else if (obj.name === 'shitou') {
} else if (obj.name.startsWith('shitou')) {
obj.castShadow = true
obj.receiveShadow = true
this.ammoPhysicWorld.addRigidBodyWithMeshObj(createRigidBodyByThreeObject(
obj as THREE.Mesh,
{
......@@ -572,17 +573,17 @@ export class CarScene extends PerspectiveScene {
console.log(this.dirLight)
this.dirLight && (this.dirLight.target = vehicleIns.chassisMesh)
const planeGeometry = new THREE.BoxGeometry(100, 2, 100)
// planeGeometry.rotateX( - Math.PI / 2 ); // 这里加了旋转矩阵 物理世界 记得要转换一下
const planeMesh = new THREE.Mesh(planeGeometry, new THREE.MeshPhongMaterial({
color: 0xffffff,
side: THREE.DoubleSide,
// wireframe: true
}))
planeMesh.position.y = -1
// @ts-ignore
planeMesh.material = terrainMesh.material
this.scene.add(planeMesh)
// const planeGeometry = new THREE.BoxGeometry(100, 2, 100)
// // planeGeometry.rotateX( - Math.PI / 2 ); // 这里加了旋转矩阵 物理世界 记得要转换一下
// const planeMesh = new THREE.Mesh(planeGeometry, new THREE.MeshPhongMaterial({
// color: 0xffffff,
// side: THREE.DoubleSide,
// // wireframe: true
// }))
// planeMesh.position.y = -1
// // @ts-ignore
// planeMesh.material = terrainMesh.material
// this.scene.add(planeMesh)
// this.ammoPhysicWorld.addMesh(planeMesh, {
......@@ -832,7 +833,8 @@ export class CarScene extends PerspectiveScene {
set currDistance(v: number) {
this._currDistance = v
GDispather.dispatchEvent('distanceUpdateSync', {
distance: v
distance: v,
circleNo: this.rotateNum.toFixed(2)
})
}
......@@ -910,7 +912,8 @@ export class CarScene extends PerspectiveScene {
onGameSubmit(n: number) {
console.log('当前分数:', Math.abs(n), '圈数:', (this.rotateNum / Math.PI / 2).toFixed(2))
GDispather.dispatchEvent('distanceUpdate', {
distance: Math.abs(n)
distance: Math.abs(n),
circleNo: this.rotateNum.toFixed(2)
})
if (this.UICtn.querySelector('.tips')) {
this.UICtn.querySelector('.tips').textContent = '当前提交分数:' + Math.abs(n).toFixed(2)
......
......@@ -5,7 +5,7 @@ export const ResJson = {
"name": "UI"
},
{
"keys": "luntai.gltf,qiche_V6.gltf,shamo_V10.gltf",
"keys": "luntai.gltf,qiche_V6.gltf,shamo_V10.gltf,shamo_V14_L(1).gltf",
"name": "gltf"
},
{
......@@ -14,5 +14,5 @@ export const ResJson = {
}
],
// eslint-disable-next-line
"path": "https://yun.duiba.com.cn/db_games/activity/template/1663753225/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/template/1664156899/resource/"
}
\ No newline at end of file
......@@ -6,12 +6,14 @@ type GDType = {
isPortrait: boolean // 是否是竖屏
},
'distanceUpdate': {
distance: number
distance: number,
circleNo: string
},
'resetVehicle': any,
'changeCameraPos': any,
'distanceUpdateSync': {
distance: number
distance: number,
circleNo: string
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment