Compare commits

...

7 Commits

Author SHA1 Message Date
cb0396e23c Merge pull request 'feat: liaison entre les molécules et couleur' (#9) from feat/molecule/bons into develop
Reviewed-on: #9
Reviewed-by: Mathis <mathis.ragot@epitech.eu>
2024-01-18 14:47:23 +01:00
aca2898e8c Merge remote-tracking branch 'origin/develop' into feat/molecule/bons
# Conflicts:
#	Assets/Editor/Vuforia/ImageTargetTextures/T-VIR/hydro_scaled.jpg.meta
#	Assets/Editor/Vuforia/ImageTargetTextures/T-VIR/hydrogen_scaled.jpg.meta
#	Assets/Editor/Vuforia/ImageTargetTextures/T-VIR/hydrogene_marker_scaled.jpg.meta
#	Assets/Editor/Vuforia/ImageTargetTextures/T-VIR/oxy_scaled.jpg.meta
#	Assets/Editor/Vuforia/ImageTargetTextures/T-VIR/oxygen_scaled.jpg.meta
#	Assets/Editor/Vuforia/ImageTargetTextures/T-VIR/oxygene_marker_scaled.jpg.meta
#	Assets/XR/Settings/OpenXR Package Settings.asset
#	Assets/__Scenes/MainMenu.unity
2024-01-18 13:46:44 +01:00
1bf7031f32 on est good 2024-01-18 14:24:40 +01:00
5ca3d16a29 Squashed commit of the following:
commit 807aa8c3c6e62c5d033064e3190ae432fb66db03
Merge: 34f74aa 3777d06
Author: Clement <clement@jo85.com>
Date:   Thu Jan 18 12:02:57 2024 +0100

    Merge pull request 'add Atomes Factory' (#10) from feature/AtomesFactory into develop

    Reviewed-on: #10
    Reviewed-by: Clement <clement@jo85.com>

commit 3777d06a0ee942994fdfe90d71fc5056c37346d9
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 12:00:00 2024 +0100

    Rename Classname

commit 16bd5bfb6cd51e253e22417ab8196a58e1726849
Merge: da9d57b 34f74aa
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 11:46:03 2024 +0100

    Merge remote-tracking branch 'origin/develop' into feature/AtomesFactory

commit da9d57b0bba34dbe24f5e7f744ce60f430832ff4
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 11:44:22 2024 +0100

    vue foria config

commit 5346e596c8a0db7684b64920c328abee459926d9
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 11:28:02 2024 +0100

    [feature/AtomesFactory] - remove testing file

commit f613217658cf2f1f48ceeeaa3183e515de857213
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 10:38:59 2024 +0100

    [feature/AtomesFactory] - Add json for atomes

commit bc2b9e02fdb692d56937bd37cc3d821ffb717424
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Fri Jan 12 15:37:09 2024 +0100

    add Atomes Factory

commit 34f74aa44366c6d5f9e0d647a7837704edbd5fad
Merge: 8b6d07f f181fd9
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:50:43 2024 +0100

    Merge pull request 'feature/multi_targets' (#7) from feature/multi_targets into develop

    Reviewed-on: #7
    Reviewed-by: Clement <clement@jo85.com>

commit f181fd993504c811a4546e56f83eb05ed62a625d
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:50:10 2024 +0100

    fix du mauvais nom de scene dans le script ChangeScene.cs

commit 1c76868eee12406d6c39fa64da8462e35019a39e
Merge: f1ec062 8b6d07f
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:39:02 2024 +0100

    Merge remote-tracking branch 'origin/develop' into feature/multi_targets

commit f1ec062047ba68d48493b25273ba5893f42a890f
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:37:29 2024 +0100

    ajout du font fallback

commit 9c23975b204ceb09bd3ccc57b847cf0a8158fb95
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:36:49 2024 +0100

    rajouts des fonts text mesh pro

commit aff9df22cfbed9e8b317cafe4269fce891a5bbe5
Merge: a791273 73394e5
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:03:32 2024 +0100

    Merge remote-tracking branch 'origin/develop' into feature/multi_targets

commit a7912733e5fed60b9514c778fd9f40661dc66b64
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 10:54:51 2024 +0100

    Ajout dans le canvas d'éléments UI (nom, description....)

commit 0313fe28a1b718152015a401fda32069e94303c0
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 09:57:07 2024 +0100

    Suppression du build de la CI

commit 5237a32bb4759c43104e9397cb43b328a99b7c62
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Thu Jan 11 16:18:35 2024 +0100

    ajout de la keystore de debug (user) + changement de la target version d'android

commit afa265dd3141ef3fd96bff685ca655594453a876
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Thu Jan 11 11:26:53 2024 +0100

    Affichage des molécules unitairement et en mode fusion

commit 84136dcc5c3b00603ba8531901418125a832a255
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Dec 22 15:05:47 2023 +0100

    MAJ du fichier d'action build.yaml

commit ce3c95654431f25e22810481f3b10b24f158decd
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Dec 22 15:02:10 2023 +0100

    MAJ du fichier d'action build.yaml

commit 8f105732f7aaa41689894ab388675ae0b79f66f6
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Dec 22 14:36:52 2023 +0100

    Ajout de la multitarget pour générer un préfab
2024-01-18 14:00:09 +01:00
824a8fdbc6 feat: WIP color 2024-01-18 12:03:38 +01:00
c302d4c277 color okay 2024-01-18 11:25:51 +01:00
13c59458bb sync 2024-01-12 16:28:35 +01:00
12 changed files with 231 additions and 6 deletions

View File

@ -158,6 +158,19 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []

View File

@ -158,6 +158,19 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []

View File

@ -158,6 +158,19 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []

View File

@ -158,6 +158,19 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []

View File

@ -158,6 +158,19 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []

View File

@ -158,6 +158,19 @@ TextureImporter:
ignorePlatformSupport: 0 ignorePlatformSupport: 0
androidETC2FallbackOverride: 0 androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0 forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: [] sprites: []

View File

@ -348,10 +348,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9f0ebc320a151d3408ea1e9fce54d40e, type: 3} m_Script: {fileID: 11500000, guid: 9f0ebc320a151d3408ea1e9fce54d40e, type: 3}
m_Name: OpenXR Package Settings m_Name: OpenXR Package Settings
m_EditorClassIdentifier: m_EditorClassIdentifier:
Keys: 0100000007000000 Keys: 01000000070000000d000000
Values: Values:
- {fileID: -2820601610673514729} - {fileID: -2820601610673514729}
- {fileID: -7933880819051152802} - {fileID: -7933880819051152802}
- {fileID: 2102387217465899027}
--- !u!114 &328694643663705065 --- !u!114 &328694643663705065
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -455,6 +456,21 @@ MonoBehaviour:
company: Unity company: Unity
priority: 0 priority: 0
required: 0 required: 0
--- !u!114 &2102387217465899027
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b5a1f07dc5afe854f9f12a4194aca3fb, type: 3}
m_Name: WebGL
m_EditorClassIdentifier:
features: []
m_renderMode: 1
m_depthSubmissionMode: 0
--- !u!114 &2292148946669457467 --- !u!114 &2292148946669457467
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.3708985, g: 0.37837005, b: 0.3572253, a: 1} m_IndirectSpecularColor: {r: 0.37311918, g: 0.3807398, b: 0.35872716, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -332,6 +332,52 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 136169417} m_GameObject: {fileID: 136169417}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &524575261
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 524575263}
- component: {fileID: 524575262}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &524575262
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 524575261}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8c2433f4f2c3ba343851fdf3c660c21e, type: 3}
m_Name:
m_EditorClassIdentifier:
moleculeJson: {fileID: 4900000, guid: 3a11d0f923ae50c4d82ee1dda0f629a3, type: 3}
atomJson: {fileID: 4900000, guid: ab8f44086e6af6f48a38b7d7d595e9a2, type: 3}
--- !u!4 &524575263
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 524575261}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.5532938, y: -1.3569599, z: -4.0075746}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &534669303 --- !u!1 &534669303
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1250,3 +1296,4 @@ SceneRoots:
- {fileID: 693850230} - {fileID: 693850230}
- {fileID: 732397232} - {fileID: 732397232}
- {fileID: 534669306} - {fileID: 534669306}
- {fileID: 524575263}

View File

@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
class MoleculeFactoryTester: MonoBehaviour {
public TextAsset moleculeJson;
public TextAsset atomJson;
void Start(){
MoleculeFactory factory = MoleculeFactory.getInstrance(this.moleculeJson);
AtomeFactory atomeFactory = AtomeFactory.getInstrance(this.atomJson);
factory.setAtomFactory(atomeFactory);
GameObject mol = factory.createMolecule("O2");
GameObject mol2 = factory.createMolecule("H2O");
mol.transform.position = new Vector3(0,1,0);
GameObject mol3 = factory.createMolecule("C4H10");
mol3.transform.position = new Vector3(0,5,0);
//GameObject bon = GameOject.CreatePrimitive(PrimitiveType.)
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8c2433f4f2c3ba343851fdf3c660c21e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -93,6 +93,23 @@
"meltingPoint": -138.3, "meltingPoint": -138.3,
"boilingPoint": -0.5 "boilingPoint": -0.5
} }
},{
"name": "Eau",
"formula": "H2O",
"atoms": [
{"element": "O", "geometry": [0.0, 0.0, 0.0]},
{"element": "H", "geometry": [1.2, 0.0, 0.0]},
{"element": "H", "geometry": [-1.2, 0.0, 0.0]}
],
"bonds": [
{"atoms": [0, 1], "order": 1},
{"atoms": [0, 2], "order": 1}
],
"properties": {
"molecularMass": 18.01528,
"meltingPoint": 0.0,
"boilingPoint": 100.0
}
} }
] ]
} }

View File

@ -8,11 +8,12 @@ public class MoleculeFactory : MonoBehaviour{
public TextAsset jsonFile; public TextAsset jsonFile;
private AtomeFactory atomeFactory;
private static MoleculeFactory instance; private static MoleculeFactory instance;
private Molecules moleculesInJson; private Molecules moleculesInJson;
private Dictionary<string, Molecule> moleculesDictionary; private Dictionary<string, Molecule> moleculesDictionary;
public MoleculeFactory(TextAsset jsonFile){ public MoleculeFactory(TextAsset jsonFile){
MoleculeFactory.instance = this; MoleculeFactory.instance = this;
@ -49,11 +50,41 @@ public class MoleculeFactory : MonoBehaviour{
sphere.transform.parent = sortie.transform; sphere.transform.parent = sortie.transform;
sphere.name = atom.element; sphere.name = atom.element;
sphere.transform.localPosition = new Vector3(atom.geometry[0], atom.geometry[1], atom.geometry[2]); sphere.transform.localPosition = new Vector3(atom.geometry[0], atom.geometry[1], atom.geometry[2]);
//TODO: géré les laision AtomeInformation att = atomeFactory.createAtome(atom.element);
//TODO: géré la taille de l'atome Color myColor = new Color(0, 0, 1, 1);
//TODO: géré la couleur de l'atome ColorUtility.TryParseHtmlString(att.representation.color, out myColor);
sphere.GetComponent<Renderer>().material.color = myColor;
}
foreach (Bond bond in molecule.bonds){
float atom1x = molecule.atoms[bond.atoms[0]].geometry[0];
float atom2x = molecule.atoms[bond.atoms[1]].geometry[0];
float atom1y = molecule.atoms[bond.atoms[0]].geometry[1];
float atom2y = molecule.atoms[bond.atoms[1]].geometry[1];
float atom1z = molecule.atoms[bond.atoms[0]].geometry[2];
float atom2z = molecule.atoms[bond.atoms[1]].geometry[2];
Vector3 vecAtom1 = new Vector3(atom1x, atom1y, atom1z);
Vector3 vecAtom2 = new Vector3(atom2x, atom2y, atom2z);
GameObject GObond = CreateCylinderBetweenPoints(vecAtom1,vecAtom2, 0.3f);
GObond.transform.parent = sortie.transform;
} }
return sortie; return sortie;
} }
public void setAtomFactory(AtomeFactory atomeFactory){
this.atomeFactory = atomeFactory;
}
private GameObject CreateCylinderBetweenPoints(Vector3 start, Vector3 end, float width){
var offset = end - start;
var scale = new Vector3(width, offset.magnitude / 2.0f, width);
var position = start + (offset / 2.0f);
var cylinderPrefab = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
cylinderPrefab.transform.position = position;
cylinderPrefab.transform.rotation = Quaternion.identity;
cylinderPrefab.transform.up = offset;
cylinderPrefab.transform.localScale = scale;
return cylinderPrefab;
}
} }