Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all
Unified · Split
| @@ -1485,9 +1485,10 @@ void Application::removeVoxel(glm::vec3 position, · 1484 unmodified lines | |||
| 1485 | 1485 | ||
| 1486 | void Application::shootParticle() { | 1486 | void Application::shootParticle() { |
| 1487 | 1487 | ||
| 1488 | glm::vec3 position = _viewFrustum.getOffsetPosition(); | 1488 | glm::vec3 position = _viewFrustum.getPosition(); |
| 1489 | glm::vec3 direction = _viewFrustum.getOffsetDirection(); | 1489 | glm::vec3 direction = _viewFrustum.getDirection(); |
| 1490 | glm::vec3 lookingAt = position + (direction * 0.2f); | 1490 | const float LINEAR_VELOCITY = 30.0f; |
| 1491 | glm::vec3 lookingAt = position + (direction * LINEAR_VELOCITY); | ||
| 1491 | 1492 | ||
| 1492 | const float radius = 0.5 / TREE_SCALE; | 1493 | const float radius = 0.5 / TREE_SCALE; |
| 1493 | xColor color = { 255, 0, 0}; | 1494 | xColor color = { 255, 0, 0}; |
| @@ -1495,7 +1496,10 @@ void Application::shootParticle() { · 1 unmodified line | |||
| 1495 | glm::vec3 gravity = DEFAULT_GRAVITY; | 1496 | glm::vec3 gravity = DEFAULT_GRAVITY; |
| 1496 | float damping = DEFAULT_DAMPING; | 1497 | float damping = DEFAULT_DAMPING; |
| 1497 | QString updateScript(""); | 1498 | QString updateScript(""); |
| 1498 | makeParticle(position, radius, color, velocity, gravity, damping, updateScript); | 1499 | |
| 1500 | makeParticle(position / (float)TREE_SCALE, radius, color, | ||
| 1501 | velocity / (float)TREE_SCALE, gravity, damping, updateScript); | ||
| 1502 | |||
| 1499 | } | 1503 | } |
| 1500 | 1504 | ||
| 1501 | void Application::makeParticle(glm::vec3 position, float radius, xColor color, glm::vec3 velocity, | 1505 | void Application::makeParticle(glm::vec3 position, float radius, xColor color, glm::vec3 velocity, |
| @@ -1507,6 +1511,9 @@ void Application::makeParticle(glm::vec3 position, float radius, xColor color, g · 5 unmodified lines | |||
| 1507 | 1511 | ||
| 1508 | // queue the packet | 1512 | // queue the packet |
| 1509 | _particleEditSender.queueParticleEditMessages(PACKET_TYPE_PARTICLE_ADD, 1, &addParticleDetail); | 1513 | _particleEditSender.queueParticleEditMessages(PACKET_TYPE_PARTICLE_ADD, 1, &addParticleDetail); |
| 1514 | |||
| 1515 | // release them | ||
| 1516 | _particleEditSender.releaseQueuedMessages(); | ||
| 1510 | } | 1517 | } |
| 1511 | 1518 | ||
| 1512 | 1519 | ||